Skip to content

Commit d16a220

Browse files
authoredMar 19, 2025··
ci(release): branch protection improvements (#58)
* ci(release-manifest): sync prerelease and release manifest * ci(release): remove initial checks - the checks will run once the PR is created as a required check * ci(release): add RELEASE_WORKFLOW_TOKEN - in order for the PR to run the required checks * ci(release): move prelease-manifest update to release-config - the steps would require permission to push in to main but this is not possible because of branch protection - to avoid it all together we add it in the release PR instead * ci(workflows): update and document triggers
1 parent 63aac83 commit d16a220

8 files changed

+24
-52
lines changed
 

‎.github/release-config.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
"release-type": "simple",
33
"packages": {
44
".": {
5-
"type": "generic"
5+
"type": "generic",
6+
"extra-files": [
7+
{
8+
"type": "json",
9+
"path": ".github/prerelease-manifest.json",
10+
"jsonpath": "$[\".\"]"
11+
}
12+
]
613
}
714
}
815
}

‎.github/release-manifest.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
{".":"0.3.0"}
1+
{
2+
".": "0.3.0"
3+
}

‎.github/workflows/codeql-package.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: "Security and Code-Quality scan with CodeQL - Package"
22

33
on:
4-
push:
5-
branches: [ "main" ]
4+
# Triggers the workflow on pull request events but only for default and protected branches
65
pull_request:
76
branches: [ "main" ]
7+
# Triggers the workflow on a schedule every Monday at 6:39 AM
88
schedule:
99
- cron: '39 6 * * 1'
1010
# Allows you to run this workflow manually from the Actions tab

‎.github/workflows/codeql-samples-quickstart.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
name: "Security and Code-Quality scan with CodeQL - Quickstart Sample"
22

33
on:
4-
push:
5-
branches: [ "main" ]
4+
# Triggers the workflow on pull request events but only for default and protected branches
65
pull_request:
76
branches: [ "main" ]
7+
# Triggers the workflow on a schedule every Monday at 6:36 AM
88
schedule:
9-
- cron: '28 6 * * 1'
9+
- cron: '36 6 * * 1'
1010
# Allows you to run this workflow manually from the Actions tab
1111
workflow_dispatch:
1212
# Triggers the workflow when it is called from another workflow

‎.github/workflows/e2e-test-fusionauth-latest-ios-latest.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow performs a full End 2 End test of the App
22
# It runs the test on the last 5 iOS releases.
33

4-
name: E2E Test with latest FusionAuth
4+
name: E2E Test with latest FusionAuth and latest iOS
55

66
on:
77
# Triggers the workflow on pull request events but only for default and protected branches

‎.github/workflows/mobsf.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: "Vulnerability Scan with MobSF"
22

33
on:
4-
push:
5-
branches: [ "main" ]
4+
# Triggers the workflow on pull request events but only for default and protected branches
65
pull_request:
76
branches: [ "main" ]
7+
# Triggers the workflow on a schedule every Monday at 6:30 AM
88
schedule:
99
- cron: '30 6 * * 1'
1010
# Allows you to run this workflow manually from the Actions tab

‎.github/workflows/release.yaml

+3-40
Original file line numberDiff line numberDiff line change
@@ -53,32 +53,12 @@ jobs:
5353
name: Run Prerelease E2E Tests
5454
uses: ./.github/workflows/e2e-test-fusionauth-latest-ios-latest.yml
5555

56-
# This job runs a MobSF scan as a prerequisite for the prerelease-prep
57-
mobsf:
58-
name: Run Prerelease MobSF Scan
59-
uses: ./.github/workflows/mobsf.yml
60-
61-
# This job runs a SwiftLint scan as a prerequisite for the prerelease-prep
62-
swiftlint:
63-
name: Run Prerelease Swiftlint
64-
uses: ./.github/workflows/swiftlint.yml
65-
66-
# This job runs a CodeQL package scan as a prerequisite for the prerelease-prep
67-
codeql-package:
68-
name: Run Prerelease CodeQL Package Scan
69-
uses: ./.github/workflows/codeql-package.yml
70-
71-
# This job runs a CodeQL samples quickstart scan as a prerequisite for the prerelease-prep
72-
codeql-samples-quickstart:
73-
name: Run Prerelease CodeQL Samples Quickstart Scan
74-
uses: ./.github/workflows/codeql-samples-quickstart.yml
75-
7656
# This job creates or finalizes a prerelease pull request or finalizes a release pull request
7757
# and provides the necessary outputs for the subsequent jobs
7858
prerelease-prep:
7959
name: Create Prerelease Pull Request
8060
runs-on: ubuntu-latest
81-
needs: [ label-check, initial-e2e-test, mobsf, swiftlint, codeql-package, codeql-samples-quickstart ]
61+
needs: [ label-check, initial-e2e-test ]
8262
outputs:
8363
# This output is used to determine if a release was created
8464
releases_created: ${{ steps.release.outputs.releases_created }}
@@ -91,6 +71,7 @@ jobs:
9171
with:
9272
config-file: ".github/prerelease-config.json"
9373
manifest-file: ".github/prerelease-manifest.json"
74+
token: ${{ secrets.RELEASE_WORKFLOW_TOKEN }}
9475

9576
# This job runs tests before the creation of the prerelease
9677
prerelease-test:
@@ -137,6 +118,7 @@ jobs:
137118
with:
138119
config-file: ".github/release-config.json"
139120
manifest-file: ".github/release-manifest.json"
121+
token: ${{ secrets.RELEASE_WORKFLOW_TOKEN }}
140122

141123
# This job runs post-prerelease steps
142124
post-prerelease:
@@ -162,25 +144,6 @@ jobs:
162144
run: |
163145
echo "Running release step!"
164146
165-
- name: Checkout
166-
uses: actions/checkout@v4.2.2
167-
168-
- name: Sync prerelease manifest
169-
env:
170-
MANIFEST_PATH: .github/prerelease-manifest.json
171-
RELEASE_TAG: ${{ needs.prerelease-prep.outputs.tag_name }}
172-
run: |
173-
jq --arg tag "${RELEASE_TAG//v/}" '.["."] = $tag' $MANIFEST_PATH > temp.json \
174-
&& mv temp.json $MANIFEST_PATH
175-
176-
- name: Commit change
177-
run: |
178-
git config user.name "github-actions[bot]"
179-
git config user.email "github-actions[bot]@users.noreply.github.com"
180-
git add . $MANIFEST_PATH
181-
git commit -m "chore: sync release manifests"
182-
git push
183-
184147
# This job runs post-release steps
185148
post-release:
186149
name: Post Release Steps

‎.github/workflows/swiftlint.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: "Code-Quality scan with SwiftLint"
22

33
on:
4-
push:
5-
branches: [ "main" ]
4+
# Triggers the workflow on pull request events but only for default and protected branches
65
pull_request:
76
branches: [ "main" ]
7+
# Triggers the workflow on a schedule every Monday at 6:33 AM
88
schedule:
99
- cron: '33 6 * * 1'
1010
# Allows you to run this workflow manually from the Actions tab

0 commit comments

Comments
 (0)
Please sign in to comment.