Skip to content

Commit b0f1be6

Browse files
committed
ci: inline Dependabot CI build (cross-repo reusable workflows unsupported for Dependabot)
1 parent 3aeb35b commit b0f1be6

1 file changed

Lines changed: 75 additions & 5 deletions

File tree

.github/workflows/dependabot-ci.yml

Lines changed: 75 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,81 @@ name: Dependabot CI
22
on:
33
pull_request_target:
44
branches: [develop, main]
5+
6+
permissions:
7+
contents: read
8+
packages: read
9+
statuses: write
10+
511
jobs:
612
build:
13+
runs-on: ubuntu-latest
714
if: github.actor == 'dependabot[bot]'
8-
uses: fireflyframework/.github/.github/workflows/java-ci.yml@main
9-
with:
10-
java-version: '25'
11-
checkout-ref: ${{ github.event.pull_request.head.sha }}
12-
trigger-downstream: false
15+
steps:
16+
- name: Checkout PR code
17+
uses: actions/checkout@v4
18+
with:
19+
ref: ${{ github.event.pull_request.head.sha }}
20+
21+
- name: Set up JDK 25
22+
uses: actions/setup-java@v4
23+
with:
24+
java-version: '25'
25+
distribution: temurin
26+
cache: maven
27+
28+
- name: Configure GitHub Packages
29+
run: |
30+
mkdir -p ~/.m2
31+
cat > ~/.m2/settings.xml << 'EOF'
32+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
33+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
34+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
35+
<servers>
36+
<server>
37+
<id>github</id>
38+
<username>${env.GITHUB_ACTOR}</username>
39+
<password>${env.GITHUB_TOKEN}</password>
40+
</server>
41+
</servers>
42+
<profiles>
43+
<profile>
44+
<id>github-packages</id>
45+
<repositories>
46+
<repository>
47+
<id>github</id>
48+
<url>https://maven.pkg.github.com/fireflyframework/fireflyframework-parent</url>
49+
<snapshots><enabled>true</enabled></snapshots>
50+
<releases><enabled>true</enabled></releases>
51+
</repository>
52+
</repositories>
53+
</profile>
54+
</profiles>
55+
<activeProfiles>
56+
<activeProfile>github-packages</activeProfile>
57+
</activeProfiles>
58+
</settings>
59+
EOF
60+
61+
- name: Build with Maven
62+
run: mvn -B verify
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
66+
- name: Report build status
67+
if: always()
68+
env:
69+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
run: |
71+
if [ "${{ job.status }}" = "success" ]; then
72+
STATE="success"
73+
DESC="Dependabot build passed"
74+
else
75+
STATE="failure"
76+
DESC="Dependabot build failed"
77+
fi
78+
gh api "repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha }}" \
79+
-f state="$STATE" \
80+
-f context="build / build" \
81+
-f description="$DESC" \
82+
-f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"

0 commit comments

Comments
 (0)