Skip to content

Commit

Permalink
Remove deprecated set-output in GitHub workflow for release
Browse files Browse the repository at this point in the history
Completely removing the intermediate step calculating the tag_name as
GitHub Actions is now providing this value in the context directly.
See https://github.com/orgs/community/discussions/26686 and
https://docs.github.com/en/actions/learn-github-actions/contexts#github-context

part of com-pas#307

Signed-off-by: Aurélien Pupier <apupier@redhat.com>
  • Loading branch information
apupier committed Feb 3, 2023
1 parent f014927 commit cde985d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/release-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Extract tag name
id: extract_tagname
shell: bash
# Extract the tag name from the git reference, value of GITHUB_REF will be something like refs/tags/<tag_name>.
run: echo "##[set-output name=tagname;]$(echo ${GITHUB_REF##*/})"

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
Expand All @@ -56,7 +50,7 @@ jobs:
output_file: custom_maven_settings.xml
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
- name: Set version with Maven
run: ./mvnw -B versions:set -DprocessAllModules=true -DnewVersion=${{ steps.extract_tagname.outputs.tagname }}
run: ./mvnw -B versions:set -DprocessAllModules=true -DnewVersion=${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy with Maven to GitHub Packages and Docker Hub
Expand Down

0 comments on commit cde985d

Please sign in to comment.