From de8b31288f22fec0763b075958c492d7e4f5c395 Mon Sep 17 00:00:00 2001 From: Jace Browning Date: Fri, 1 Nov 2024 16:21:53 -0400 Subject: [PATCH 1/4] Set up token to publish demo --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 01e8bce..f9b1c71 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,7 +42,7 @@ jobs: path: temp - name: Test template in demo repo - if: github.ref_name == 'main' && github.event_name != 'pull_request' + # if: github.ref_name == 'main' && github.event_name != 'pull_request' run: | # Configure Git with GHA information, for more info see: # https://github.com/actions/checkout?tab=readme-ov-file#push-a-commit-using-the-built-in-token From 27e827d4ad78f3288f51536f5f369fbe2b4fc1b1 Mon Sep 17 00:00:00 2001 From: Jace Browning Date: Fri, 1 Nov 2024 16:23:52 -0400 Subject: [PATCH 2/4] move action --- .github/workflows/main.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f9b1c71..8b9a3e1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -44,11 +44,6 @@ jobs: - name: Test template in demo repo # if: github.ref_name == 'main' && github.event_name != 'pull_request' run: | - # Configure Git with GHA information, for more info see: - # https://github.com/actions/checkout?tab=readme-ov-file#push-a-commit-using-the-built-in-token - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - # Delete the current repository rm -rf .git @@ -58,6 +53,8 @@ jobs: # Rebuild the repository from the generated files and push to GitHub cd TemplateDemo + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git add --all git commit -m "Deploy GHA build ${{ github.run_id }} to GitHub" git push From 332f2165131f9e340d117075b176cdd8a333f2ef Mon Sep 17 00:00:00 2001 From: Jace Browning Date: Fri, 1 Nov 2024 16:26:01 -0400 Subject: [PATCH 3/4] test on pr --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8b9a3e1..f1c5f9c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,7 +35,7 @@ jobs: run: make all - name: Checkout demo repo - if: github.ref_name == 'main' && github.event_name != 'pull_request' + # if: github.ref_name == 'main' && github.event_name != 'pull_request' uses: actions/checkout@v4 with: repository: jacebrowning/template-python-demo From ff8c682a1506c30cfd0b37d5361e5bd1282b6d47 Mon Sep 17 00:00:00 2001 From: Jace Browning Date: Fri, 1 Nov 2024 16:31:47 -0400 Subject: [PATCH 4/4] push with token --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f1c5f9c..80802ce 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,6 +43,8 @@ jobs: - name: Test template in demo repo # if: github.ref_name == 'main' && github.event_name != 'pull_request' + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} run: | # Delete the current repository rm -rf .git @@ -53,8 +55,6 @@ jobs: # Rebuild the repository from the generated files and push to GitHub cd TemplateDemo - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git add --all git commit -m "Deploy GHA build ${{ github.run_id }} to GitHub" - git push + git push -f https://${GH_TOKEN}@github.com/jacebrowning/template-python-demo main