Files
ansible-collection-hardening/.github/workflows/galaxy-publish.yml
T
renovate[bot] 28f9ef09ed chore(deps): update actions/checkout digest to 11bd719
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-16 20:50:58 +00:00

46 lines
1.5 KiB
YAML

---
name: Publish collection to Ansible Galaxy
on: # yamllint disable-line rule:truthy
release:
types:
- released
jobs:
deploy:
if: github.repository == 'dev-sec/ansible-collection-hardening'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
# deploy the collection first, because if it fails, we don't want
# to update the galaxy.yml
- name: Deploy the collection
uses: artis3n/ansible_galaxy_collection@3368f56529a2ef47ef0ac1ecfcda039f90d0174a # v2
with:
api_key: ${{ secrets.GALAXY_API_KEY }}
galaxy_version: ${{ github.event.release.tag_name }}
# checkout master instead of the release-tag so we can push the galaxy.yml
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
ref: master
- name: update galaxy.yml with new version
uses: microsoft/variable-substitution@6287962da9e5b6e68778dc51e840caa03ca84495 # v1
with:
files: 'galaxy.yml'
env:
version: "${{ github.event.release.tag_name }}"
- name: push galaxy.yml
uses: github-actions-x/commit@722d56b8968bf00ced78407bbe2ead81062d8baa # v2.9
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
push-branch: 'master'
commit-message: 'update galaxy.yml with new version'
force-add: 'true'
files: galaxy.yml
name: dev-sec CI
email: [email protected]