Skip to content

Commit

Permalink
feat: repo-ansible workflow #9358
Browse files Browse the repository at this point in the history
Update workflow to pick up on the docs/partial changes (part of the
README.md file generation). Tweak comment posted on a PR.
  • Loading branch information
mhitza committed Jan 21, 2025
1 parent ac81a67 commit 8eb5789
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 4 additions & 2 deletions tasks/generate-files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
state: directory

- name: Generate repo-ansible workflow
ansible.builtin.copy:
src: ./templates/.github/workflows/auto-run-repo-ansible.yaml
ansible.builtin.template:
src: ./templates/.github/workflows/auto-run-repo-ansible.yaml.j2
dest: "{{ repo_path }}/.github/workflows/auto-run-repo-ansible.yaml"
variable_start_string: '[['
variable_end_string: ']]'

- name: Generate dependabot automerge workflow
ansible.builtin.copy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# [[ repo_managed ]]
name: Auto-run repo-ansible

on:
Expand All @@ -6,12 +7,13 @@ on:
pull_request_target:
paths:
- 'repo.yaml'
- 'docs/partials/*.md'
push:
branches:
- main
- master
- [[ repo.github.default_branch ]]
paths:
- 'repo.yaml'
- 'docs/partials/*.md'

permissions:
contents: write # allow git commits & push
Expand Down Expand Up @@ -61,7 +63,7 @@ jobs:
- if: ${{ env.IS_PULL_REQUEST == '1' && env.REPOSITORY_CHANGED == '1' }}
name: comment with changes
name: bot comment about repo-ansible detected changes
uses: actions/github-script@v7
with:
script: |
Expand All @@ -70,7 +72,7 @@ jobs:
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Following repo-ansible changes will be applied when merged to main/master branch
body: `Once PR is merged, repo-ansible will run on [[ repo.github.default_branch ]] and the following changes will apply
\`\`\`shell
${changes}
Expand Down

0 comments on commit 8eb5789

Please sign in to comment.