Skip to content

Commit 12471ce

Browse files
Merge pull request #64 from kamalsaleh/master
Resolve PR number for Codecov workflow_run
2 parents f691227 + 5036cbe commit 12471ce

3 files changed

Lines changed: 18 additions & 3 deletions

File tree

.github/workflows/Codecov.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ jobs:
1111
if: >-
1212
github.event.workflow_run.conclusion == 'success' &&
1313
github.event.workflow_run.event != 'schedule'
14+
permissions:
15+
actions: read
16+
contents: read
17+
pull-requests: read
1418
runs-on: ubuntu-latest
1519
steps:
1620
- name: Check out repo
@@ -26,10 +30,22 @@ jobs:
2630
- name: Restore coverage files
2731
run: |
2832
cp -v /tmp/coverage-artifacts/*.json . 2>/dev/null || true
33+
- name: Resolve PR number on PR events
34+
id: resolve_pr
35+
env:
36+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
run: |
38+
PR_NUMBER=""
39+
if [ "${{ github.event.workflow_run.event }}" = "pull_request" ]; then
40+
HEAD="${{ github.event.workflow_run.head_repository.owner.login }}:${{ github.event.workflow_run.head_branch }}"
41+
PR_NUMBER=$(gh api "repos/${{ github.repository }}/pulls?state=all&head=${HEAD}" --jq ".[0].number // empty")
42+
fi
43+
echo "pr_number=${PR_NUMBER}" >> "$GITHUB_OUTPUT"
44+
echo "Resolved PR: ${PR_NUMBER:-(none)}"
2945
- name: Upload to Codecov
3046
env:
3147
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
3248
CODECOV_COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
3349
CODECOV_BRANCH: ${{ github.event.workflow_run.head_branch }}
34-
CODECOV_PR: ${{ github.event.workflow_run.pull_requests[0].number }}
50+
CODECOV_PR: ${{ steps.resolve_pr.outputs.pr_number }}
3551
run: ./dev/upload_codecov.sh

.github/workflows/Tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ jobs:
3939
- name: Check out repo
4040
uses: actions/checkout@v4
4141
with:
42-
# the persisted token interferes with the subsplit token used below
4342
persist-credentials: false
4443
fetch-depth: 0
4544
- name: Move checked out repo to GAP user root dir

PackageInfo.g

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SetPackageInfo( rec(
1010

1111
PackageName := "FinGSetsForCAP",
1212
Subtitle := "The (skeletal) elementary topos of finite G-sets",
13-
Version := "2026.04-06",
13+
Version := "2026.04-07",
1414

1515
Date := (function ( ) if IsBound( GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE ) then return GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE; else return Concatenation( ~.Version{[ 1 .. 4 ]}, "-", ~.Version{[ 6, 7 ]}, "-01" ); fi; end)( ),
1616
License := "GPL-2.0-or-later",

0 commit comments

Comments
 (0)