Search code examples
gitgithubyamlgithub-actionsdevops

GitHub Actions: The requested URL returned error: 403 in github workflow


I have created a github workflow, on my Special Repo, and I want to use some of created packages to make my special repo more interactive. The repo I am using: 3D-profile

My yml script:

name: GitHub-Profile-3D-Contrib

on:
  schedule: # 03:00 JST == 18:00 UTC
    - cron: "0 18 * * *"
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    name: generate-github-profile-3d-contrib
    steps:
      - uses: actions/[email protected]
      - uses: yoshi389111/[email protected]
        env:
          GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
          USERNAME: ${{ github.repository_owner }}
      - name: Commit & Push
        run: |
          git config user.name github-actions
          git config user.email [email protected]
          git add -A .
          git commit -m "generated"
          git push

But it fails, here is the log:

Run git config user.name github-actions
  git config user.name github-actions
  git config user.email [email protected]
  git add -A .
  git commit -m "generated"
  git push
  shell: /usr/bin/bash -e {0}
[main baea2cb] generated
 10 files changed, 10 insertions(+)
 create mode 100644 profile-3d-contrib/profile-gitblock.svg
 create mode 100644 profile-3d-contrib/profile-green-animate.svg
 create mode 100644 profile-3d-contrib/profile-green.svg
 create mode 100644 profile-3d-contrib/profile-night-green.svg
 create mode 100644 profile-3d-contrib/profile-night-rainbow.svg
 create mode 100644 profile-3d-contrib/profile-night-view.svg
 create mode 100644 profile-3d-contrib/profile-season-animate.svg
 create mode 100644 profile-3d-contrib/profile-season.svg
 create mode 100644 profile-3d-contrib/profile-south-season-animate.svg
 create mode 100644 profile-3d-contrib/profile-south-season.svg
remote: Permission to AhmadMujtaba200210/AhmadMujtaba200210.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/AhmadMujtaba200210/AhmadMujtaba200210/': The requested URL returned error: 403
Error: Process completed with exit code 128.

What I have tried: I have a ACCESS token with all permissions, still fails.


Solution

  • name: GitHub-Profile-3D-Contrib
    
    on:
      schedule: # 03:00 JST == 18:00 UTC
        - cron: "0 18 * * *"
      workflow_dispatch:
    
    jobs:
      build:
        runs-on: ubuntu-latest
        name: generate-github-profile-3d-contrib
        steps:
          - uses: actions/[email protected]
            with:
              token: ${{ secrets.ACCESS_TOKEN }}
          - uses: yoshi389111/[email protected]
            env:
              GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
              USERNAME: ${{ github.repository_owner }}
          - name: Commit & Push
            run: |
              git config user.name github-actions
              git config user.email [email protected]
              git add -A .
              git commit -m "generated"
              git push
    

    add checkout token before other use.