chrnorm/deployment-status

`Error: fatal: repository 'https://github.com/XXX/XXX/' not found`

ricardovanlaarhoven opened this issue · 4 comments

Hi,

Since i've added this package to my firebase deployment i'm getting this error in the actions/checkout

Error: fatal: repository 'https://github.com/XXX/XXX/' not found

Fetching the repository
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +b71152daa2a490f5d1e90536de60b68b0e9c7914:refs/remotes/origin/main
  remote: Repository not found.
  Error: fatal: repository 'https://github.com/***/***/' not found
  The process '/usr/bin/git' failed with exit code 128
  Waiting 19 seconds before trying again
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +b71152daa2a[49](https://github.com/***/***/runs/7108769901?check_suite_focus=true#step:2:54)0f5d1e90536de60b68b0e9c7914:refs/remotes/origin/main
  remote: Repository not found.
  Error: fatal: repository 'https://github.com/***/***/' not found
  The process '/usr/bin/git' failed with exit code 128
  Waiting 10 seconds before trying again
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +b711[52](https://github.com/***/***/runs/7108769901?check_suite_focus=true#step:2:57)daa2a490f5d1e90[53](https://github.com/***/***/runs/7108769901?check_suite_focus=true#step:2:58)6de60b68b0e9c7914:refs/remotes/origin/main
  remote: Repository not found.
  Error: fatal: repository 'https://github.com/***/***/' not found
  Error: The process '/usr/bin/git' failed with exit code 128
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy Customer Portal (test) to Firebase
'on':
  push:
    paths:
      - 'customer-portal/**'
    branches:
      - main
jobs:
  build_and_deploy:
    permissions:
      deployments: write

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - uses: chrnorm/deployment-action@v2
      name: Create GitHub deployment
      id: deployment
      with:
        token: '${{ github.token }}'
        environment-url:  ******
        environment: test

    - run: npm ci && npm run build
      working-directory: customer-portal
    - uses: FirebaseExtended/action-hosting-deploy@v0
      with:
        repoToken: '${{ secrets.GITHUB_TOKEN }}'
        firebaseServiceAccount:  ******
        channelId: test
        projectId:  ******
        expires: 30d
        entrypoint: ./customer-portal
    - name: Update deployment status (success)
      if: success()
      uses: chrnorm/deployment-status@v2
      with:
        token: '${{ github.token }}'
        environment-url:  ******
        state: 'success'
        deployment-id: ${{ steps.deployment.outputs.deployment_id }}

    - name: Update deployment status (failure)
      if: failure()
      uses: chrnorm/deployment-status@v2
      with:
        token: '${{ github.token }}'
        environment-url: ******
        state: 'failure'
        deployment-id: ${{ steps.deployment.outputs.deployment_id }}

When reverting the lines i've added everything works fine again

it's specific when adding

    permissions:
      deployments: write

You don't need to declare

    permissions:
      deployments: write

When you do this you end up overwriting the defaults and the defaults these days already have deployments: write set. I think this repo is just outdated in mentioning that fact

Default Permissions:

GITHUB_TOKEN Permissions
  Actions: write
  Checks: write
  Contents: write
  Deployments: write
  Discussions: write
  Issues: write
  Metadata: read
  Packages: write
  Pages: write
  PullRequests: write
  RepositoryProjects: write
  SecurityEvents: write
  Statuses: write

Permissions when adding just

GITHUB_TOKEN Permissions `deployments: write`
  Deployments: write
  Metadata: read

I ended up with using a github app for doing this. With the github token you can create a deployment, but that deployment may not start other actions. And that's what we wanted.