Skip to content

Test current branch #12

Test current branch

Test current branch #12

name: Test current branch
on: [workflow_call, workflow_dispatch]
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/*pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Run action (non-branch version)
id: run-action-non-branch-version
uses: maven-flow/manage-versions@main
with:
enforce-branch-version: true
maven-args: "-P github"
pom-file: "non-branch-version-pom.xml"
secrets: inherit

Check failure on line 28 in .github/workflows/test-current-branch.yml

View workflow run for this annotation

GitHub Actions / Test current branch

Invalid workflow file

The workflow is not valid. .github/workflows/test-current-branch.yml (Line: 28, Col: 7): Unexpected value 'secrets' .github/workflows/test-current-branch.yml (Line: 45, Col: 7): Unexpected value 'secrets'
- name: Assert version unchanged
run: |
projectVersion=$(mvn -B help:evaluate -Dexpression=project.version -q -DforceStdout --file non-branch-version-pom.xml)
if [[ $projectVersion != "1.0.0" ]]; then
echo "Bad version! Expected '1.0.0' but was '$projectVersion'"
exit 1
fi
- name: Run action (branch version)
id: run-action-branch-version
uses: maven-flow/manage-versions@main
with:
enforce-branch-version: true
maven-args: "-P github"
pom-file: "branch-version-pom.xml"
secrets: inherit
- name: Assert version changed
run: |
projectVersion=$(mvn -B help:evaluate -Dexpression=project.version -q -DforceStdout --file branch-version-pom.xml)
if [[ $projectVersion != "1.0.1-SNAPSHOT" ]]; then
echo "Bad version! Expected '1.0.1-SNAPSHOT' but was '$projectVersion'"
exit 1
fi