Skip to content

Commit

Permalink
Only perform the action on a new tag in the main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
sscheib committed Mar 17, 2024
1 parent c7a2d65 commit 6323b74
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/ansible-galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
name: 'Publish latest release to Ansible Galaxy and create a new GitHub release'
on: # yamllint disable-line rule:truthy
push:
branches:
- 'main'
tags:
- 'v*'
workflow_dispatch: {}
Expand All @@ -15,18 +13,18 @@ jobs:
steps:
- name: 'checkout'
uses: 'actions/checkout@v4'
if: "startsWith(github.ref, 'refs/tags/')"
if: "github.ref_name == 'main'"

- name: 'galaxy'
uses: 'robertdebock/[email protected]'
if: "startsWith(github.ref, 'refs/tags/')"
if: "github.ref_name == 'main'"
with:
galaxy_api_key: '${{ secrets.galaxy_api_key }}'
git_branch: 'main'

- name: 'Create a new release on GitHub'
uses: 'softprops/action-gh-release@v2'
if: "startsWith(github.ref, 'refs/tags/')"
if: "github.ref_name == 'main'"
with:
draft: false
prerelease: false
Expand Down

0 comments on commit 6323b74

Please sign in to comment.