Skip to content

Commit f5edeec

Browse files
authored
fix: reuse release workflow (#67)
* fix: reuse release workflow * use action
1 parent 241eed0 commit f5edeec

File tree

1 file changed

+10
-30
lines changed

1 file changed

+10
-30
lines changed

.github/workflows/main.yml

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -18,37 +18,17 @@ jobs:
1818
node-version: 18
1919

2020
release:
21+
needs: [test]
2122
concurrency: release
2223
runs-on: ubuntu-latest
23-
needs: [test]
24-
if: github.ref_name == 'main'
25-
env:
26-
# Value must match in the test job.
27-
NODE_VERSION: 18
24+
# Release if:
25+
# - the repo's owner is Ocado Tech.
26+
# - a change is made to the default branch.
27+
if: |
28+
github.repository_owner_id == 2088731 &&
29+
github.ref_name == github.event.repository.default_branch
2830
steps:
29-
- uses: actions/checkout@v4
30-
with:
31-
token: ${{ secrets.CFL_BOT_GITHUB_TOKEN }}
32-
fetch-depth: 0
33-
34-
- name: 🌐 Set up Node ${{ env.NODE_VERSION }}
35-
uses: actions/setup-node@v4
36-
with:
37-
node-version: ${{ env.NODE_VERSION }}
38-
39-
- name: 🛠 Install Dependencies
40-
run: |
41-
npm install --global npm
42-
npm install --global \
43-
semantic-release@^20.1.1 \
44-
@semantic-release/git@^10.0.1 \
45-
@semantic-release/changelog@^6.0.2
46-
4731
- name: 🚀 Publish Semantic Release
48-
env:
49-
GH_TOKEN: ${{ secrets.CFL_BOT_GITHUB_TOKEN }}
50-
GIT_AUTHOR_NAME: cfl-bot
51-
GIT_AUTHOR_EMAIL: [email protected]
52-
GIT_COMMITTER_NAME: cfl-bot
53-
GIT_COMMITTER_EMAIL: [email protected]
54-
run: npx semantic-release
32+
uses: ocadotechnology/codeforlife-workspace/.github/actions/github/release@main
33+
with:
34+
cfl-bot-gh-token: ${{ secrets.CFL_BOT_GH_TOKEN }}

0 commit comments

Comments
 (0)