From c7c888af78bb59791f87dd3bc044bcb948a17a82 Mon Sep 17 00:00:00 2001 From: SKairinos Date: Thu, 14 Nov 2024 09:17:27 +0000 Subject: [PATCH 1/2] fix: reuse release workflow --- .github/workflows/main.yml | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2f3ac8b5..e584cce1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,37 +18,6 @@ jobs: node-version: 18 release: - concurrency: release - runs-on: ubuntu-latest needs: [test] - if: github.ref_name == 'main' - env: - # Value must match in the test job. - NODE_VERSION: 18 - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.CFL_BOT_GITHUB_TOKEN }} - fetch-depth: 0 - - - name: 🌐 Set up Node ${{ env.NODE_VERSION }} - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - - - name: 🛠 Install Dependencies - run: | - npm install --global npm - npm install --global \ - semantic-release@^20.1.1 \ - @semantic-release/git@^10.0.1 \ - @semantic-release/changelog@^6.0.2 - - - name: 🚀 Publish Semantic Release - env: - GH_TOKEN: ${{ secrets.CFL_BOT_GITHUB_TOKEN }} - GIT_AUTHOR_NAME: cfl-bot - GIT_AUTHOR_EMAIL: codeforlife-bot@ocado.com - GIT_COMMITTER_NAME: cfl-bot - GIT_COMMITTER_EMAIL: codeforlife-bot@ocado.com - run: npx semantic-release + uses: ocadotechnology/codeforlife-workspace/.github/workflows/release.yaml@main + secrets: inherit From 385a90620f1be7ef00ee012a261501d8b462eb47 Mon Sep 17 00:00:00 2001 From: SKairinos Date: Wed, 20 Nov 2024 12:11:13 +0000 Subject: [PATCH 2/2] use action --- .github/workflows/main.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e584cce1..7bce8c2d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,5 +19,16 @@ jobs: release: needs: [test] - uses: ocadotechnology/codeforlife-workspace/.github/workflows/release.yaml@main - secrets: inherit + concurrency: release + runs-on: ubuntu-latest + # Release if: + # - the repo's owner is Ocado Tech. + # - a change is made to the default branch. + if: | + github.repository_owner_id == 2088731 && + github.ref_name == github.event.repository.default_branch + steps: + - name: 🚀 Publish Semantic Release + uses: ocadotechnology/codeforlife-workspace/.github/actions/github/release@main + with: + cfl-bot-gh-token: ${{ secrets.CFL_BOT_GH_TOKEN }}