Skip to content

Commit 054504c

Browse files
authored
chore: convert reusable workflows to composite actions (#114)
BREAKING CHANGE: Converts updater and danger reusable workflows to composite actions for improved reliability and easier consumption. ## Key Changes **Architecture:** - Move `.github/workflows/updater.yml` → `updater/action.yml` - Move `.github/workflows/danger.yml` → `danger/action.yml` - Bundle scripts locally instead of downloading at runtime - Include checkout step within actions for seamless user experience **API Changes:** - Convert `secrets.api-token` to `inputs.api-token` - Remove `_workflow_version` parameter (no longer needed) - Add proper input validation and error handling **Documentation:** - Split into dedicated README files with complete examples - Include required permissions in usage examples - Provide migration guide with before/after examples ## Migration Required ```yaml # Before (v2) jobs: update: uses: getsentry/github-workflows/.github/workflows/updater.yml@v2 secrets: api-token: ${{ secrets.CI_DEPLOY_KEY }} # After (v3) jobs: update: runs-on: ubuntu-latest steps: - uses: getsentry/github-workflows/updater@v3 with: api-token: ${{ secrets.CI_DEPLOY_KEY }} Resolves #113 Co-authored-by: Claude noreply@anthropic.com
1 parent c8c3a19 commit 054504c

File tree

12 files changed

+708
-535
lines changed

12 files changed

+708
-535
lines changed

.craft.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
minVersion: 0.23.1
22
changelogPolicy: auto
3-
preReleaseCommand: pwsh scripts/update-version.ps1
3+
preReleaseCommand: pwsh -cwa ''
44
artifactProvider:
55
name: none
66
targets:

.github/workflows/danger-workflow-tests.yml

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,38 @@ on:
55
pull_request:
66
types: [opened, synchronize, reopened, edited, ready_for_review]
77

8-
jobs:
9-
danger:
10-
uses: ./.github/workflows/danger.yml
11-
with:
12-
_workflow_version: ${{ github.sha }}
8+
permissions:
9+
contents: read
10+
pull-requests: write
11+
statuses: write
1312

14-
test-outputs:
13+
jobs:
14+
# Test Danger action on pull requests - should analyze PR and report findings
15+
pr-analysis:
1516
runs-on: ubuntu-latest
16-
needs: danger
1717
steps:
18-
- run: "[[ '${{ needs.danger.outputs.outcome }}' == 'success' ]]"
18+
- uses: actions/checkout@v4
19+
20+
- name: Run danger action
21+
id: danger
22+
uses: ./danger
23+
24+
- name: Validate danger outputs
25+
env:
26+
DANGER_OUTCOME: ${{ steps.danger.outputs.outcome }}
27+
run: |
28+
echo "🔍 Validating Danger action outputs..."
29+
echo "Danger Outcome: '$DANGER_OUTCOME'"
30+
31+
# Validate that Danger ran successfully
32+
if [[ "$DANGER_OUTCOME" != "success" ]]; then
33+
echo "❌ Expected Danger outcome 'success', got '$DANGER_OUTCOME'"
34+
echo "This could indicate:"
35+
echo " - Danger found issues that caused it to fail"
36+
echo " - The action itself encountered an error"
37+
echo " - Docker container issues"
38+
exit 1
39+
fi
40+
41+
echo "✅ Danger PR analysis completed successfully!"
42+
echo "ℹ️ Check the PR comments for any Danger findings"

.github/workflows/danger.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.github/workflows/updater.yml

Lines changed: 0 additions & 287 deletions
This file was deleted.

0 commit comments

Comments
 (0)