Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 7 additions & 17 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ jobs:
- name: Display inputs
run: echo "${{ github.event.inputs.version }}"

- name: Check PAT token is still valid
run: |
gh workflow list --repo "$GITHUB_REPOSITORY_OWNER/flood-service"
env:
# if this fails the create/regenerate classic PAT and then populate it using `gh secret set GH_WORKFLOW`
GH_TOKEN: ${{ secrets.GH_WORKFLOW }}

- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # 4.3.1
with:
Expand Down Expand Up @@ -65,8 +58,7 @@ jobs:
prCheck flood-service master
prCheck flood-service development
env:
# create classic PAT and then run `gh secret set GH_WORKFLOW`
GH_TOKEN: ${{ secrets.GH_WORKFLOW }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: npm ci --engine-strict --ignore-scripts
Expand All @@ -80,20 +72,18 @@ jobs:
git merge --no-edit $RELEASE_BRANCH
git push origin master

- name: Create GitHub Release
run: gh release create $TAG_VERSION --title "Release $VERSION" --notes "[release notes](/$RELEASE_NOTES_FILE)"
env:
# create classic PAT and then run `gh secret set GH_WORKFLOW`
GH_TOKEN: ${{ secrets.GH_WORKFLOW }}

- name: Merge release branch into development
run: |
git switch development
git merge --no-edit $RELEASE_BRANCH
git push origin development

- name: Create GitHub Release
run: gh release create $TAG_VERSION --title "Release $VERSION" --notes "[release notes](/$RELEASE_NOTES_FILE)"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Trigger Merge Release Branch for flood-service
run: gh workflow run --repo "$GITHUB_REPOSITORY_OWNER/flood-service" merge.yml -f version="$VERSION"
env:
# use PAT token with repo scope (github.token didn't work)
GH_TOKEN: ${{ secrets.GH_WORKFLOW }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13 changes: 2 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ jobs:
- name: Display inputs
run: echo "${{ github.event.inputs.jira_release_id }} ${{ github.event.inputs.increment }} ${{ github.event.inputs.db_changes }} ${{ github.event.inputs.proposed_release_date }}"

- name: Check PAT token is still valid
run: |
gh workflow list --repo "$GITHUB_REPOSITORY_OWNER/flood-service"
env:
# if this fails the create/regenerate classic PAT and then populate it using `gh secret set GH_WORKFLOW`
GH_TOKEN: ${{ secrets.GH_WORKFLOW }}

- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # 4.3.1
with:
Expand Down Expand Up @@ -109,14 +102,12 @@ jobs:
gh pr create --base master --title "Release $VERSION" --body "TBC"
gh pr create --base development --title "Release $VERSION" --body "TBC"
env:
# create classic PAT and then run `gh secret set GH_WORKFLOW`
GH_TOKEN: ${{ secrets.GH_WORKFLOW }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Trigger release creation for flood-service
run: gh workflow run --repo "$GITHUB_REPOSITORY_OWNER/flood-service" release.yml -f increment="${{ github.event.inputs.increment }}" -f proposed_release_date="${{ github.event.inputs.proposed_release_date }}" -f jira_release_id="${{ github.event.inputs.jira_release_id }}"
env:
# use PAT token with repo scope (github.token didn't work)
GH_TOKEN: ${{ secrets.GH_WORKFLOW }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Clean up
if: ${{ failure() }}
Expand Down
Loading