I am trying to execute below piece of code using GitHub actions are getting a 403 while pushing the repository. None of the documentation seems to be helping here. Please help me know if I am missing something.
name: Env Variables
on: push
env:
WF_ENV: Available to all jobs
jobs:
create_issue:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Update pre requisites
run: |
sudo apt-get -y install git
- name: Checkout the repo
uses: actions/checkout@v2
- name: Push a random file
run: |
set -xe
pwd
ls -a
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
ls -a
echo $RANDOM >> random.txt
ls -a
git add .
git commit -m "[ACTIONS GITHUB]:Added a Random file"
git remote set-url --add --push origin "https://$GITHUB_ACTOR:$token@github.com/$GITHUB_REPOSITORY.git"
- name: Push the changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}