Skip to content

Commit

Permalink
[TD-1474]: Version support for sync automation (#135)
Browse files Browse the repository at this point in the history
* Update templates in sync bundle

* [TD-1567]: Move pac.yml to gpac bundle.

       - Also move repo-policy out of ci/

* Update gromit image version used
  • Loading branch information
asutosh authored Mar 2, 2023
1 parent 15bb06b commit 638fe1f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 0 deletions.
File renamed without changes.
17 changes: 17 additions & 0 deletions policy/templates/sync/.github/workflows/sync-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ on:
jobs:
sync:
runs-on: ubuntu-latest
container: tykio/gromit:v1.5

strategy:
fail-fast: false
Expand All @@ -53,6 +54,7 @@ jobs:
- name: sync ${{`{{matrix.branch}}`}} from master
id: sync-changes
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config --local user.email "policy@gromit"
git config --local user.name "Bender"
git fetch origin ${{`{{ matrix.branch }}`}}
Expand All @@ -74,6 +76,21 @@ jobs:
echo "::debug::Commit ${{`{{ github.sha }} syncd for ${{matrix.branch}}`}}"
exit 0

- name: Generate releng bundle using latest gromit templates for {{`${{matrix.branch}}`}}
id: gromit-bundle-gen
run: |
# add gh cli to gromit container
apk add --no-cache github-cli
# get the tarball for the latest gromit master - it will have the latest version of
# the templates.
mkdir /tmp/gromit-src && gh api -H "Accept: application/vnd.github+json" /repos/TykTechnologies/gromit/tarball/master | tar --strip-components 1 -C /tmp/gromit-src -xzf -
gromit bundle gen --branch {{`${{ matrix.branch }}`}} --bundle /tmp/gromit-src/policy/templates/releng --repo tyk .
git add -A && git commit -m "[CI]: Automated releng bundle sync by sync-automation"
git push origin {{`${{ steps.sync-changes.outputs.prbranch }}`}}
exit 0
env:
GITHUB_TOKEN: {{`${{ secrets.ORG_GH_TOKEN }}`}}

- name: Create PR from the branch.
id: create-pr
uses: actions/github-script@v6
Expand Down

0 comments on commit 638fe1f

Please sign in to comment.