diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 1de96d4d..0cd4e10d 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -78,8 +78,6 @@ jobs: defaults: run: working-directory: ./implementations/${{ matrix.package }} - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout uses: actions/checkout@v2 @@ -99,26 +97,10 @@ jobs: - name: Deploy run: yarn deploy - - name: Check for changes in URI.txt - run: | - git add . - git diff --name-only | grep ^URI.txt$ - echo "changed=$?" >> $GITHUB_ENV - - - name: Commit files - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git commit -m "Add deployments" -a - if: env.changed == 0 - - - name: Push changes - run: | - git branch -c main artifacts_${{ matrix.package }}_${{ github.run_id }} - git push origin artifacts_${{ matrix.package }}_${{ github.run_id }} - if: env.changed == 0 - - - name: Create PR - run: | - gh pr create --title "New deployment artifacts" --body "" --base main --head artifacts_${{ matrix.package }}_${{ github.run_id }} - if: env.changed == 0 + - name: PR New URI + uses: peter-evans/create-pull-request@v3 + with: + branch: ${{ matrix.package }}-cd-pr-${{github.event.number}} + commit-message: "[CD] ${{ matrix.package }}" + title: "[CD] ${{ matrix.package }}" + body: "Triggered by: https://github.com/${{github.repository}}/pull/${{github.event.number}}"