Skip to content

Commit

Permalink
test: staging (#1190)
Browse files Browse the repository at this point in the history
* test PR opening on kakarot

* fix staging

* delete token

* fix

* fix staging

* fix

* uncomment
  • Loading branch information
greged93 authored Jun 14, 2024
1 parent 3650b1f commit 3ec0300
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ on: workflow_dispatch
jobs:
stage:
runs-on: ubuntu-latest
permissions: write-all
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GH_TOKEN }}
- name: install foundry
uses: foundry-rs/foundry-toolchain@v1
with:
Expand Down Expand Up @@ -63,24 +65,19 @@ jobs:
has_diff=$?
set -e
echo "has_diff=$has_diff" >> $GITHUB_ENV
- name: Create and push branch for deployment updates
- name: Create PR for deployment updates
if: ${{ env.has_diff == 1 }}
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
set +e
cd lib/kakarot
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git checkout -b update-staging-deployment-${{ github.run_id }}
git checkout -b update-staging-deployment-run-${{ github.run_id }}
git add deployments/kakarot-staging/
git commit -m "Update staging deployments from run ${{ github.run_id }}"
git push --set-upstream origin update-staging-deployment-${{ github.run_id }}
- name: Open PR on Kakarot
if: ${{ env.has_diff == 1 }}
run: |
set +e
curl -X POST \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-H "Accept: application/vnd.github+json" \
https://api.github.com/repos/kkrt-labs/kakarot/pulls \
-d '{"title":"Update staging deployments from run ${{ github.run_id }}","head":"update-staging-deployment-${{ github.run_id }}","base":"main","body":"This PR updates the staging deployments for staging run ${{ github.run_id }}."}'
git push --set-upstream origin update-staging-deployment-run-${{ github.run_id }} --force
gh pr create --repo=kkrt-labs/kakarot --base=main --head=update-staging-deployment-run-${{ github.run_id }} \
--title "Update staging deployments from staging run ${{ github.run_id }}" \
--body "This PR updates the staging deployments for staging run ${{ github.run_id }}."

0 comments on commit 3ec0300

Please sign in to comment.