使用 GitHub 操作推送存储库时出错:接收 403

时间:2021-07-14 07:19:03

标签: github github-actions

我正在尝试使用 GitHub 操作执行以下代码段,在推送存储库时收到 403。似乎没有任何文档在这里有所帮助。如果我遗漏了什么,请帮助我。

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 }}

0 个答案:

没有答案