From 3c9758a3da1f3b92e24278f6d362ff96d9aadcfd Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Tue, 2 Jul 2024 14:59:53 +0200 Subject: [PATCH 1/6] ci: Make action proper --- .github/workflows/build.yml | 38 --------------- .github/workflows/external-contributors.yml | 54 +++++++++++++++++++++ 2 files changed, 54 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/external-contributors.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9edd073a637c..8930bcaf3c64 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -229,44 +229,6 @@ jobs: message: | ⚠️ This PR is opened against **master**. You probably want to open it against **develop**. - job_external_contributor: - name: External Contributors - needs: job_install_deps - runs-on: ubuntu-20.04 - if: | - github.event_name == 'pull_request' - && (github.event.action == 'opened' || github.event.action == 'reopened') - && github.event.pull_request.author_association != 'COLLABORATOR' - && github.event.pull_request.author_association != 'MEMBER' - && github.event.pull_request.author_association != 'OWNER' - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - - name: Set up Node - uses: actions/setup-node@v4 - with: - node-version-file: 'package.json' - - name: Check dependency cache - uses: actions/cache/restore@v4 - with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }} - key: ${{ needs.job_install_deps.outputs.dependency_cache_key }} - fail-on-cache-miss: true - - - name: Add external contributor to CHANGELOG.md - uses: ./dev-packages/external-contributor-gh-action - with: - name: ${{ github.event.pull_request.user.login }} - - name: Create PR with changes - uses: peter-evans/create-pull-request@v6 - with: - commit-message: "ref: Add external contributor to CHANGELOG.md" - title: "ref: Add external contributor to CHANGELOG.md" - branch: 'external-contributor/patch-${{ github.event.pull_request.user.login }}' - delete-branch: true - body: This PR adds the external contributor to the CHANGELOG.md file, so that they are credited for their contribution. - job_build: name: Build needs: [job_get_metadata, job_install_deps] diff --git a/.github/workflows/external-contributors.yml b/.github/workflows/external-contributors.yml new file mode 100644 index 000000000000..136d6aa6f2d1 --- /dev/null +++ b/.github/workflows/external-contributors.yml @@ -0,0 +1,54 @@ +name: "CI: Mention external contributors" +on: + pull_request: + types: + - closed + branches: + - develop + +env: + NX_CACHE_RESTORE_KEYS: | + nx-Linux-${{ github.ref }}-${{ github.sha }} + nx-Linux-${{ github.ref }} + nx-Linux + +jobs: + external_contributor: + name: External Contributors + runs-on: ubuntu-20.04 + if: | + github.event.pull_request.author_association != 'COLLABORATOR' + && github.event.pull_request.author_association != 'MEMBER' + && github.event.pull_request.author_association != 'OWNER' + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version-file: 'package.json' + cache: 'yarn' + + - name: Install dependencies + run: yarn install --frozen-lockfile + - name: NX cache + uses: actions/cache/restore@v4 + with: + path: .nxcache + key: nx-Linux-${{ github.ref }}-${{ github.sha }} + restore-keys: ${{ env.NX_CACHE_RESTORE_KEYS }} + + - name: Add external contributor to CHANGELOG.md + uses: ./dev-packages/external-contributor-gh-action + with: + name: ${{ github.event.pull_request.user.login }} + - name: Create PR with changes + uses: peter-evans/create-pull-request@v6 + with: + commit-message: "ref: Add external contributor to CHANGELOG.md" + title: "ref: Add external contributor to CHANGELOG.md" + branch: 'external-contributor/patch-${{ github.event.pull_request.user.login }}' + delete-branch: true + body: This PR adds the external contributor to the CHANGELOG.md file, so that they are credited for their contribution. + From 666a0b02f2900b87692c7db1faa852701250ae48 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Tue, 2 Jul 2024 15:00:18 +0200 Subject: [PATCH 2/6] WIP try it? --- .github/workflows/external-contributors.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/external-contributors.yml b/.github/workflows/external-contributors.yml index 136d6aa6f2d1..708fceb642f0 100644 --- a/.github/workflows/external-contributors.yml +++ b/.github/workflows/external-contributors.yml @@ -1,10 +1,6 @@ name: "CI: Mention external contributors" on: pull_request: - types: - - closed - branches: - - develop env: NX_CACHE_RESTORE_KEYS: | @@ -16,10 +12,6 @@ jobs: external_contributor: name: External Contributors runs-on: ubuntu-20.04 - if: | - github.event.pull_request.author_association != 'COLLABORATOR' - && github.event.pull_request.author_association != 'MEMBER' - && github.event.pull_request.author_association != 'OWNER' steps: - uses: actions/checkout@v4 with: From 5633d70ba2cc864149d735507968761b0a652c83 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Tue, 2 Jul 2024 15:03:35 +0200 Subject: [PATCH 3/6] remove cache part... --- .github/workflows/external-contributors.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/external-contributors.yml b/.github/workflows/external-contributors.yml index 708fceb642f0..9df038f2bc49 100644 --- a/.github/workflows/external-contributors.yml +++ b/.github/workflows/external-contributors.yml @@ -2,12 +2,6 @@ name: "CI: Mention external contributors" on: pull_request: -env: - NX_CACHE_RESTORE_KEYS: | - nx-Linux-${{ github.ref }}-${{ github.sha }} - nx-Linux-${{ github.ref }} - nx-Linux - jobs: external_contributor: name: External Contributors @@ -24,12 +18,6 @@ jobs: - name: Install dependencies run: yarn install --frozen-lockfile - - name: NX cache - uses: actions/cache/restore@v4 - with: - path: .nxcache - key: nx-Linux-${{ github.ref }}-${{ github.sha }} - restore-keys: ${{ env.NX_CACHE_RESTORE_KEYS }} - name: Add external contributor to CHANGELOG.md uses: ./dev-packages/external-contributor-gh-action From e6d3f6568cdb42a8260301d68bf01f48bad7a80c Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Tue, 2 Jul 2024 15:05:58 +0200 Subject: [PATCH 4/6] fix PR base --- .github/workflows/external-contributors.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/external-contributors.yml b/.github/workflows/external-contributors.yml index 9df038f2bc49..172c856cda82 100644 --- a/.github/workflows/external-contributors.yml +++ b/.github/workflows/external-contributors.yml @@ -29,6 +29,7 @@ jobs: commit-message: "ref: Add external contributor to CHANGELOG.md" title: "ref: Add external contributor to CHANGELOG.md" branch: 'external-contributor/patch-${{ github.event.pull_request.user.login }}' + base: 'develop' delete-branch: true body: This PR adds the external contributor to the CHANGELOG.md file, so that they are credited for their contribution. From fee806508451124af85c703436d861a7817b55d6 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Tue, 2 Jul 2024 15:13:28 +0200 Subject: [PATCH 5/6] Revert "WIP try it?" This reverts commit 666a0b02f2900b87692c7db1faa852701250ae48. --- .github/workflows/external-contributors.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/external-contributors.yml b/.github/workflows/external-contributors.yml index 172c856cda82..4e895c5109fb 100644 --- a/.github/workflows/external-contributors.yml +++ b/.github/workflows/external-contributors.yml @@ -1,11 +1,19 @@ name: "CI: Mention external contributors" on: pull_request: + types: + - closed + branches: + - develop jobs: external_contributor: name: External Contributors runs-on: ubuntu-20.04 + if: | + github.event.pull_request.author_association != 'COLLABORATOR' + && github.event.pull_request.author_association != 'MEMBER' + && github.event.pull_request.author_association != 'OWNER' steps: - uses: actions/checkout@v4 with: From b2313b1a3be26ca9206119cbd0325a863d239e66 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Tue, 2 Jul 2024 15:25:01 +0200 Subject: [PATCH 6/6] fix dependabot and pin to exact version --- .github/workflows/external-contributors.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/external-contributors.yml b/.github/workflows/external-contributors.yml index 4e895c5109fb..a797d93732eb 100644 --- a/.github/workflows/external-contributors.yml +++ b/.github/workflows/external-contributors.yml @@ -14,6 +14,7 @@ jobs: github.event.pull_request.author_association != 'COLLABORATOR' && github.event.pull_request.author_association != 'MEMBER' && github.event.pull_request.author_association != 'OWNER' + && github.actor != 'dependabot[bot]' steps: - uses: actions/checkout@v4 with: @@ -32,7 +33,7 @@ jobs: with: name: ${{ github.event.pull_request.user.login }} - name: Create PR with changes - uses: peter-evans/create-pull-request@v6 + uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c with: commit-message: "ref: Add external contributor to CHANGELOG.md" title: "ref: Add external contributor to CHANGELOG.md"