Fix security workflow from making multiple comments #342
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Push Drainpipe Dev Package | |
on: | |
push: | |
branches: | |
- '**' | |
tags: | |
- 'v*' | |
concurrency: | |
group: drainpipe-dev | |
cancel-in-progress: false | |
permissions: | |
contents: read | |
jobs: | |
Drainpipe-Dev: | |
name: Push branch to drainpipe-dev | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./scaffold/github/actions/common/setup-git | |
with: | |
git-name: Drainpipe Bot | |
git-email: no-reply@example.com | |
- name: Setup SSH | |
uses: webfactory/ssh-agent@v0.9.0 | |
with: | |
ssh-private-key: ${{ secrets.DRAINPIPE_DEV_DEPLOY_KEY }} | |
log-public-key: false | |
- name: Create git checkout of drainpipe-dev | |
working-directory: drainpipe-dev | |
run: | | |
git init | |
git branch -m ${{ github.ref_name }} | |
git remote add origin git@github.com:Lullabot/drainpipe-dev.git | |
git fetch origin | |
git reset --mixed origin/${{ github.ref_name }} || git reset --mixed origin/main | |
git add -A | |
git commit -m "${{ github.event.commits[0].message }}" --allow-empty | |
- name: Tag release | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
working-directory: drainpipe-dev | |
run: | | |
git tag ${{ github.ref_name }} | |
- name: Push to drainpipe-dev | |
working-directory: drainpipe-dev | |
run: | | |
git push origin ${{ github.ref_name }} | |
- name: Create release | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
run: | | |
curl -L \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.DRAINPIPE_DEV_RELEASE_TOKEN }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
https://api.github.com/repos/lullabot/drainpipe-dev/releases \ | |
-d '{"tag_name":"${{ github.ref_name }}","name":"${{ github.ref_name }}","body":"See <a href=\"https://github.com/Lullabot/drainpipe/releases/tag/${{ github.ref_name }}\">https://github.com/Lullabot/drainpipe/releases/tag/${{ github.ref_name }}</a>","draft":false,"prerelease":false,"generate_release_notes":false}' |