From 34ded642a8161744403048395857cc9815736461 Mon Sep 17 00:00:00 2001 From: lotyp Date: Tue, 14 Mar 2023 14:55:28 +0200 Subject: [PATCH 1/2] feat: updating workflow files --- .github/dependabot.yml | 16 ------------ .github/labeler.yml | 1 - .github/workflows/ci.yml | 26 ++++++++++--------- ...{release-please.yml => create-release.yml} | 7 ++--- .github/workflows/label.yml | 8 +++--- .github/workflows/shellcheck.yml | 13 +++++----- .github/workflows/sync-from-tpl.yml | 14 +++++----- .pre-commit-config.yaml | 9 +++++-- Makefile | 2 +- 9 files changed, 43 insertions(+), 53 deletions(-) delete mode 100644 .github/dependabot.yml rename .github/workflows/{release-please.yml => create-release.yml} (91%) diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 7876308..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- - -version: 2 -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" - commit-message: - include: "scope" - prefix: "github-actions" - labels: - - "deps" - open-pull-requests-limit: 10 - -... diff --git a/.github/labeler.yml b/.github/labeler.yml index d3ab3d7..71672c3 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -9,7 +9,6 @@ - ./*.md "type: maintenance": - - .dependabot/* - .github/workflows/* - app/tests/**/* - tests/**/* diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0250076..f27dd0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,5 @@ --- -name: CI - on: # yamllint disable-line rule:truthy push: branches: @@ -18,39 +16,43 @@ on: # yamllint disable-line rule:truthy # Every Sunday at 05:10 - cron: '10 5 * * 0' +name: ๐Ÿ” Continuous integration + jobs: build: - name: Build runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - os_name: ['alpine'] steps: - - uses: e1himself/goss-installation-action@v1.1.0 + - name: ๐Ÿ“ฆ Install goss + uses: e1himself/goss-installation-action@v1.1.0 - - name: Checkout - uses: actions/checkout@v3.1.0 + - name: ๐Ÿ“ฆ Check out the codebase + uses: actions/checkout@v3 + with: + fetch-depth: 0 ### For Cross Platform OSX builds uncomment these lines - - name: Set up QEMU + - name: ๐Ÿ–ฅ๏ธ Set up QEMU uses: docker/setup-qemu-action@v2 with: platforms: arm64 - - name: Set up Docker Buildx + - name: ๐Ÿš€ Set up Docker BuildX uses: docker/setup-buildx-action@v2 with: install: true - - name: Prepare environment + - name: ๐Ÿ› ๏ธ Prepare environment run: | docker network create ss_network make env env: COMPOSE_PROJECT_NAME: wod - - name: Run dcgoss tests + - name: ๐Ÿงช Run dcgoss tests run: | docker network create shared make test + +... diff --git a/.github/workflows/release-please.yml b/.github/workflows/create-release.yml similarity index 91% rename from .github/workflows/release-please.yml rename to .github/workflows/create-release.yml index 0931f5d..016010c 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/create-release.yml @@ -7,13 +7,14 @@ on: # yamllint disable-line rule:truthy branches: - master -name: Release please +name: ๐Ÿ“ฆ Create release jobs: - release-please: + release: runs-on: ubuntu-latest steps: - - uses: google-github-actions/release-please-action@v3 + - name: ๐ŸŽ‰ Create release + uses: google-github-actions/release-please-action@v3 id: release with: token: ${{ secrets.PERSONAL_GITHUB_TOKEN }} diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index 5c96af9..1c654a3 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -1,5 +1,3 @@ ---- - # This workflow will triage pull requests and apply a label based on the # paths that are modified in the pull request. # @@ -7,16 +5,16 @@ # file with configuration. For more information, see: # https://github.com/actions/labeler/blob/master/README.md -name: Add labels - on: # yamllint disable-line rule:truthy pull_request: +name: ๐Ÿท๏ธ Add labels + jobs: label: runs-on: ubuntu-latest steps: - - name: Apply labels + - name: ๐Ÿท๏ธ Apply labels uses: actions/labeler@v4 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index f46af01..bcfa96d 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -1,25 +1,24 @@ --- -name: Differential shell-check - on: # yamllint disable-line rule:truthy pull_request: +name: ๐Ÿž Differential shell-check + permissions: contents: read jobs: shellcheck: runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3.1.0 + - name: ๐Ÿ“ฆ Check out the codebase + uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Differential ShellCheck - uses: redhat-plumbers-in-action/differential-shellcheck@latest + - name: ๐Ÿž Differential shell-check + uses: redhat-plumbers-in-action/differential-shellcheck@v4 with: severity: warning token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/sync-from-tpl.yml b/.github/workflows/sync-from-tpl.yml index 8ee33b6..f66bf62 100644 --- a/.github/workflows/sync-from-tpl.yml +++ b/.github/workflows/sync-from-tpl.yml @@ -1,7 +1,5 @@ --- -name: Sync changes from upstream template - on: # yamllint disable-line rule:truthy # Trigger At 00:00 on each 1st day of month schedule: @@ -9,20 +7,24 @@ on: # yamllint disable-line rule:truthy # Manual trigger workflow_dispatch: +name: โ™ป๏ธ Sync changes from upstream template + jobs: repo-sync: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v3.1.0 + - name: ๐Ÿ“ฆ Check out the codebase + uses: actions/checkout@v3 with: token: ${{ secrets.WORKFLOW_TOKEN }} - - name: Sync changes from upstream template - uses: AndreasAugustin/actions-template-sync@v0.4.2-draft + - name: โ™ป๏ธ Sync changes from upstream template + uses: AndreasAugustin/actions-template-sync@v0.7.3 with: github_token: ${{ secrets.WORKFLOW_TOKEN }} source_repo_path: wayofdev/docker-project-services upstream_branch: master pr_labels: "type: maintenance" + +... diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d9d7989..8e00b88 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,17 +2,22 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.4.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: fix-encoding-pragma - repo: https://github.com/commitizen-tools/commitizen - rev: v2.37.0 + rev: v2.42.1 hooks: - id: commitizen stages: - commit-msg + - repo: https://github.com/rhysd/actionlint + rev: v1.6.23 + hooks: + - id: actionlint + ... diff --git a/Makefile b/Makefile index 2ada040..6ecb4d9 100644 --- a/Makefile +++ b/Makefile @@ -79,7 +79,7 @@ help: @echo ' ๐Ÿข ${YELLOW}Org wayofdev (github.com/wayofdev)${RST}' .PHONY: help -all: env mkcert up +all: hooks env mkcert up PHONY: all From f4bc162ed12d671a5201b9d0448ab32673889ef4 Mon Sep 17 00:00:00 2001 From: lotyp Date: Tue, 14 Mar 2023 14:57:02 +0200 Subject: [PATCH 2/2] feat: add auto-merge workflow --- .github/workflows/auto-merge-release.yaml | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/auto-merge-release.yaml diff --git a/.github/workflows/auto-merge-release.yaml b/.github/workflows/auto-merge-release.yaml new file mode 100644 index 0000000..729b174 --- /dev/null +++ b/.github/workflows/auto-merge-release.yaml @@ -0,0 +1,27 @@ +--- + +# https://github.com/peter-evans/enable-pull-request-automerge + +on: # yamllint disable-line rule:truthy + pull_request: + +permissions: + pull-requests: write + contents: write + +name: ๐Ÿคž Auto merge release + +jobs: + auto-merge: + if: github.actor == 'lotyp' && startsWith(github.head_ref, 'release-please--') + runs-on: ubuntu-latest + steps: + - name: ๐Ÿคž Auto-merge pull request + uses: peter-evans/enable-pull-request-automerge@v2 + with: + pull-request-number: ${{ github.event.pull_request.number }} + merge-method: merge + # to trigger other workflows, pass PAT token instead of GITHUB_TOKEN + token: ${{ secrets.PERSONAL_GITHUB_TOKEN }} + +...