Skip to content

Commit

Permalink
chore(workflow): update jobs to push ggshield formula on both gitguar…
Browse files Browse the repository at this point in the history
…dian's tap
  • Loading branch information
pierrelalanne committed Nov 25, 2021
1 parent f7c4718 commit 911c722
Showing 1 changed file with 27 additions and 5 deletions.
32 changes: 27 additions & 5 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:

push_to_tap:
needs: pypi
name: Push GitGuardian tap
name: Push to GitGuardian taps
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
steps:
Expand All @@ -123,22 +123,44 @@ jobs:
run: |
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
echo ::set-output name=TAG::${GITHUB_REF/refs\/tags\//}
- name: Checkout Homebrew-tap
uses: actions/checkout@master
with:
repository: GitGuardian/homebrew-tap
token: ${{ secrets.PAT_GITHUB }}
path: ./tap

- name: Checkout Homebrew-ggshield
uses: actions/checkout@master
with:
repository: GitGuardian/homebrew-ggshield
token: ${{ secrets.PAT_GITHUB }}
path: ./brew
path: ./ggshield

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ggshield homebrew-pypi-poet
poet -f ggshield | sed 's/Shiny new formula/Detect secret in source code, scan your repos and docker images for leaks/g' | sed '7a\ license "MIT"' > brew/Formula/ggshield.rb
poet -f ggshield \
| sed 's/Shiny new formula/Detect secrets in source code, scan your repos and docker images for leaks/g' \
| sed '7a\ license "MIT"' \
| tee ggshield/Formula/ggshield.rb tap/Formula/ggshield.rb
- name: Push to gitguardian/homebrew-tap
run: |
cd ./tap
git add Formula/ggshield.rb
git config user.name github-actions
git config user.email github-actions@github.com
git commit -am "update from ggshield"
git tag ${{ steps.tags.outputs.tag }}
git push
git push --tags
- name: Push brew
- name: Push to gitguardian/homebrew-ggshield
run: |
cd ./brew
cd ./ggshield
git add Formula/ggshield.rb
git config user.name github-actions
git config user.email github-actions@github.com
Expand Down

0 comments on commit 911c722

Please sign in to comment.