actions / actions/starter-workflows

Azure Web Apps Deploy action doesn't ask for content read permission

Open
#2,467 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
12.1k
Forks
7.3k
PR merge metrics
No merged PRs in 30d

Description

Hi,

(First of all, apologies in advance if this is the wrong repo, I found the .net6 deployment but not the .net 8 deployment in the code 😲 )

when setting up a brand new .net 8 deployment straight from the Azure portal, I encountered the following error at the "Checkout GitHub Action" step:

Fetching the repository
  "C:\Program Files\Git\bin\git.exe" -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +[REDACTED]:refs/remotes/origin/main
  remote: Repository not found.
  Error: fatal: repository 'https://github.com/lucasbfr/[REDACTED]' not found
  The process 'C:\Program Files\Git\bin\git.exe' failed with exit code 128

This is caused by a missing permission. The ones created by Azure are
permissions: id-token: write #This is required for requesting the JWT

However,
contents: read #This is required to read the repository
is required to be able to read a (I guess non public) repository.

The .net 6 version of this script worked, probably because it was not setting any permission and contents: read is the default overridden by the new version.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the referenced .NET 6 workflow at .github/actions/starter-workflows/deployments/azure-functions-app-dotnet.yml and compare it with the .NET 8 workflow generated by the Azure portal. Check the permissions block around the Checkout GitHub Action; done means a new private-repository deployment can fetch the repository successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, github-actions
Domain
ci-cd, cloud
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.