Skip to content

Commit 33afe5f

Browse files
action to verify poms
1 parent 2f0f728 commit 33afe5f

2 files changed

Lines changed: 40 additions & 1 deletion

File tree

.github/workflows/example-workflow.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
on: [workflow_dispatch]
1+
on: [workflow_dispatch, push]
22

33
jobs:
44
build:
@@ -10,3 +10,33 @@ jobs:
1010
with:
1111
sbt-plugin-project-name: 'my-sbt-plugin'
1212
maven-mirror-control: 'NO_MIRROR'
13+
14+
test-pom-organize:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Create test pom fixture
19+
run: |
20+
mkdir -p target
21+
cat > target/my-artifact-1.2.3.pom << 'EOF'
22+
<project>
23+
<description>test artifact</description>
24+
<version>1.2.3</version>
25+
<repositories>
26+
<repository>
27+
<id>test-repo</id>
28+
<url>https://example.com</url>
29+
</repository>
30+
</repositories>
31+
</project>
32+
EOF
33+
- name: Run pom-organize.sh on test fixtures
34+
run: bash pom-organize.sh
35+
- name: Commit organized poms
36+
run: |
37+
git config user.email "ci@github.com"
38+
git config user.name "CI"
39+
git add generated-poms
40+
git commit -m "test: add organized poms"
41+
- name: Test pom_organize action (re-run should produce no diff)
42+
uses: ./verify_pom

verify_pom/action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: 'Verify checked in pom.xml files'
2+
description: 'Organizes sbt-generated pom.xml files for analysis tools and verifies no uncommitted changes.'
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- run: ${{ github.action_path }}/../pom-organize.sh
7+
shell: bash
8+
- run: ${{ github.action_path }}/../pom-no-diff.sh
9+
shell: bash

0 commit comments

Comments
 (0)