Skip to content

Commit efdf7d5

Browse files
committed
ci: harden pub publish workflow with oidc check and timeout
1 parent 2dcef91 commit efdf7d5

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ permissions:
1313
jobs:
1414
publish:
1515
runs-on: ubuntu-latest
16+
timeout-minutes: 20
1617
if: github.event_name == 'workflow_dispatch' || startsWith(github.event.release.tag_name, 'v')
1718
steps:
1819
- name: Checkout
@@ -36,8 +37,15 @@ jobs:
3637
- name: Install dependencies
3738
run: flutter pub get
3839

40+
- name: Verify OIDC is available
41+
run: |
42+
if [ -z "${ACTIONS_ID_TOKEN_REQUEST_URL:-}" ]; then
43+
echo "OIDC token endpoint is not available. Check workflow permissions."
44+
exit 1
45+
fi
46+
3947
- name: Validate package
4048
run: flutter pub publish --dry-run
4149

4250
- name: Publish package
43-
run: flutter pub publish -f
51+
run: timeout 10m flutter pub publish -f

0 commit comments

Comments
 (0)