Skip to content

Commit f961913

Browse files
authored
Fix publish-devspaces workflow (#562)
Follow-Up: #558
1 parent 6ec6062 commit f961913

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.github/workflows/tox.yml

+5
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,17 @@ jobs:
117117
docker push "ghcr.io/ansible/ansible-devspaces:latest"
118118
119119
- name: Fork and Clone the target repository
120+
if: github.event_name == 'release' && github.event.action == 'published'
120121
env:
121122
GITHUB_TOKEN: ${{ secrets.ANSIBUDDY_BOT_PAT }}
122123
run: |
123124
gh repo fork [email protected]:redhat-developer-demos/ansible-devspaces-demo.git --clone
124125
cd ansible-devspaces-demo
125126
126127
- name: Create a new branch, update the file and push the branch
128+
if: github.event_name == 'release' && github.event.action == 'published'
127129
run: |
130+
cd ansible-devspaces-demo
128131
git checkout -b update-devspaces-image-${{ github.event.release.tag_name }}
129132
export SHA=$(docker manifest inspect -v ghcr.io/ansible/ansible-devspaces:latest | jq -r '[.Descriptor.digest][0]')
130133
sed -i "s|image:.*|image: ghcr.io/ansible/ansible-devspaces@${{ env.SHA }}|" devfile.yaml
@@ -133,9 +136,11 @@ jobs:
133136
git push origin update-devspaces-image-${{ github.event.release.tag_name }}
134137
135138
- name: Create a pull request
139+
if: github.event_name == 'release' && github.event.action == 'published'
136140
env:
137141
GITHUB_TOKEN: ${{ secrets.ANSIBUDDY_BOT_PAT }}
138142
run: |
143+
cd ansible-devspaces-demo
139144
gh pr create \
140145
--title "Update ansible-devspaces container image" \
141146
--body "This PR updates the ansible-devspaces container image SHA to the latest." \

0 commit comments

Comments
 (0)