chore(deps): update jenkins/ssh-agent docker tag to v5.47.0 (#122) #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Publish Github Release | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'Dockerfile' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
with: | |
ssh-key: "${{secrets.SSH_KEY}}" | |
- name: Extract Jenkins ssh-agent version | |
id: jenkins_version | |
run: | | |
VERSION=$(grep 'FROM jenkins/ssh-agent:' Dockerfile | \ | |
sed -n 's/FROM jenkins\/ssh-agent:\(.*\)@sha256.*/\1/p') | |
echo "Extracted VERSION=${VERSION}" | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Check if release already exists | |
id: check_release | |
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7 | |
with: | |
script: | | |
const { data: releases } = await github.rest.repos.listReleases({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
}); | |
const exists = releases.some(release => release.tag_name === process.env.VERSION); | |
console.log(`Release exists: ${exists}`); | |
if (exists) { | |
core.setOutput('exists', 'true'); | |
} else { | |
core.setOutput('exists', 'false'); | |
} | |
env: | |
VERSION: ${{ env.VERSION }} | |
- name: Push tag | |
if: steps.check_release.outputs.exists == 'false' && env.VERSION != '' | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git tag -a ${{ env.VERSION }} -m "${{ env.VERSION }}" | |
git push origin --tags | |
- name: Create release | |
if: steps.check_release.outputs.exists == 'false' && env.VERSION != '' | |
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2 | |
with: | |
tag_name: ${{ env.VERSION }} | |
generate_release_notes: true | |
make_latest: true | |
draft: false | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |