File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111 steps :
1212 - name : Checkout repo
1313 uses : actions/checkout@v3
14+ with :
15+ persist-credentials : false # Important! Disable default token so we can use PAT
1416
1517 - name : Generate random number (0-9)
1618 id : random
@@ -19,12 +21,13 @@ jobs:
1921 - name : Show random number
2022 run : echo "Random number was $RANDOM_NUMBER"
2123
22- - name : Maybe commit (if number is 0– 5)
24+ - name : Maybe commit (if number is 0- 5)
2325 if : ${{ env.RANDOM_NUMBER <= 5 }}
2426 run : |
2527 echo "Logging activity at $(date)" >> activity.txt
2628 git config --global user.name "GitHub Bot"
2729 git config --global user.email "bot@example.com"
2830 git add activity.txt
2931 git commit -m "Random activity $(date)"
30- git push https://x-access-token:${{ secrets.PAT }}@github.com/${{ github.repository }}.git
32+ git remote set-url origin https://x-access-token:${{ secrets.PAT }}@github.com/${{ github.repository }}.git
33+ git push origin HEAD:main
You can’t perform that action at this time.
0 commit comments