Skip to content

Commit bc17956

Browse files
authored
ci: update release dry run workflow (#67)
* ci: update release dry run workflow * ci: disable CI check for dryrun release config * ci: add ci flag for dry run * ci: finalize dry run release workflow * ci: add dry run flag * ci: use github token instead of app generated * ci: add dry run token
1 parent b7c34fb commit bc17956

File tree

2 files changed

+42
-7
lines changed

2 files changed

+42
-7
lines changed
Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,34 @@
11
name: Release (dry run)
22
on:
3-
pull_request_target:
3+
pull_request:
44
types:
55
- opened
66
- synchronize
77

8+
permissions:
9+
contents: write
10+
811
jobs:
9-
main:
10-
name: '/'
11-
uses: technology-studio/github-workflows/.github/workflows/_release.yml@main
12-
with:
13-
dry_run: true
14-
secrets: inherit
12+
release-dry-run:
13+
name: 'Release (dry run)'
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
17+
with:
18+
ref: ${{ github.event.pull_request.head.ref }}
19+
- uses: technology-studio/github-workflows/.github/actions/install-dependencies@main
20+
- run: yarn test --coverage
21+
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4
22+
- run: |
23+
echo "PR_HEAD_REF=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
24+
- run: GITHUB_ACTIONS="" yarn semantic-release --extends ./.releaserc.dryrun.js
25+
env:
26+
GITHUB_TOKEN: ${{ github.token }}
27+
NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_DRY_RUN_NPM_TOKEN }}
28+
SLACK_WEBHOOK: ${{ secrets.SEMANTIC_RELEASE_SLACK_WEBHOOK }}
29+
- name: Send a Slack message on failure
30+
if: failure()
31+
uses: technology-studio/github-workflows/.github/actions/slack-failed-job-message@main
32+
with:
33+
slack_bot_token: ${{ secrets.TXO_SLACK_BOT_APP_TOKEN }}
34+
channel_id: ${{ secrets.TXO_SLACK_GITHUB_OPS_CHANNEL_ID }}

.releaserc.dryrun.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* @Author: Rostislav Simonik <rostislav.simonik@technologystudio.sk>
3+
* @Date: 2022-08-21T13:08:66+02:00
4+
* @Copyright: Technology Studio
5+
**/
6+
7+
module.exports = {
8+
extends: [
9+
'./src/index.js',
10+
],
11+
branches: [
12+
process.env.PR_HEAD_REF,
13+
],
14+
dryRun: true,
15+
}

0 commit comments

Comments
 (0)