Skip to content

Commit 090e238

Browse files
committed
new job
1 parent dac3fbe commit 090e238

File tree

3 files changed

+41
-6
lines changed

3 files changed

+41
-6
lines changed

.copier-answers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier
2-
_commit: v0.0.106-20-g673eee8
2+
_commit: v0.0.106-21-g492f37a
33
_src_path: gh:LabAutomationAndScreening/copier-base-template.git
44
description: A web app that is hosted within a local intranet. Nuxt frontend, python
55
backend, docker-compose

.github/workflows/ci.yaml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches-ignore:
66
- 'gh-readonly-queue/**' # don't run (again) when on these special branches created during merge groups; the `on: merge_group` already triggers it.
77
merge_group:
8+
pull_request:
89

910
env:
1011
PYTHONUNBUFFERED: True
@@ -19,9 +20,26 @@ jobs:
1920
permissions:
2021
contents: write # needed for updating dependabot branches
2122

23+
check-skip-duplicate:
24+
runs-on: ubuntu-24.04
25+
permissions:
26+
contents: read
27+
pull-requests: read # needed to check if PR exists for current branch
28+
outputs:
29+
should-run: ${{ steps.check.outputs.should-run }}
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v6.0.2
33+
with:
34+
persist-credentials: false
35+
- id: check
36+
uses: ./.github/actions/check-skip-duplicates
37+
2238
pre-commit:
2339
needs:
2440
- get-values
41+
- check-skip-duplicate
42+
if: needs.check-skip-duplicate.outputs.should-run == 'true'
2543
uses: ./.github/workflows/pre-commit.yaml
2644
permissions:
2745
contents: write # needed for mutex
@@ -32,6 +50,8 @@ jobs:
3250
unit-test:
3351
needs:
3452
- pre-commit
53+
- check-skip-duplicate
54+
if: needs.check-skip-duplicate.outputs.should-run == 'true'
3555
strategy:
3656
matrix:
3757
os:
@@ -66,6 +86,8 @@ jobs:
6686
lint-matrix:
6787
needs:
6888
- pre-commit
89+
- check-skip-duplicate
90+
if: needs.check-skip-duplicate.outputs.should-run == 'true'
6991
strategy:
7092
matrix:
7193
os:
@@ -178,17 +200,21 @@ jobs:
178200
path: "${{ github.workspace }}/.precommit_cache/pre-commit.log"
179201

180202
confirm-on-tagged-copier-template:
203+
needs:
204+
- check-skip-duplicate
205+
if: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
181206
uses: ./.github/workflows/confirm-on-tagged-copier-template.yaml
182207
permissions:
183208
contents: read
184209
pull-requests: read # needed to check if PR exists for current branch
185210

186211

187-
required-check:
212+
workflow-summary:
188213
runs-on: ubuntu-24.04
189214
timeout-minutes: 2
190215
needs:
191216
- get-values
217+
- check-skip-duplicate
192218
- confirm-on-tagged-copier-template
193219
- pre-commit
194220
- unit-test
@@ -203,13 +229,26 @@ jobs:
203229
204230
if [[ ! "${{ needs.get-values.result }}" =~ $success_pattern ]] ||
205231
[[ ! "${{ needs.confirm-on-tagged-copier-template.result }}" =~ $success_pattern ]] ||
232+
[[ ! "${{ needs.check-skip-duplicate.result }}" =~ $success_pattern ]] ||
206233
[[ ! "${{ needs.pre-commit.result }}" =~ $success_pattern ]] ||
207234
[[ ! "${{ needs.unit-test.result }}" =~ $success_pattern ]] ||
208235
[[ ! "${{ needs.lint-matrix.result }}" =~ $success_pattern ]]; then
209236
echo "❌ One or more jobs did not finish with skipped or success"
210237
exit 1
211238
fi
212239
echo "✅ All jobs finished with skipped or success"
240+
241+
- name: Mark the required-check as succeeded so the PR can be merged
242+
if: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
243+
env:
244+
GH_TOKEN: ${{ github.token }}
245+
run: |
246+
gh api \
247+
-X POST -H "Accept: application/vnd.github.v3+json" \
248+
"${{ github.event.pull_request.statuses_url }}" \
249+
-f state=success -f context="required-check" -f description="✅ All required checks passed in the job triggered by pull_request" \
250+
-f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
251+
213252
- name: Mark updated dependabot hash commit as succeeded
214253
if: needs.get-values.outputs.dependabot-commit-created == 'true'
215254
env:

.github/workflows/confirm-on-tagged-copier-template.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ jobs:
2323
with:
2424
persist-credentials: false
2525

26-
- id: check
27-
uses: ./.github/actions/check-skip-duplicates
28-
2926
- name: Check _commit is a clean release tag
30-
if: ${{ steps.check.outputs.should-run != 'true' }} # only run IF there is a PR open
3127
run: |
3228
ANSWERS_FILE="${{ inputs.answers_file }}"
3329
if [ ! -f "$ANSWERS_FILE" ]; then

0 commit comments

Comments
 (0)