-
Hello! 👋 I am trying to create my own feature collection thing. I so far have one feature that works on my local PC with devcontainer features test I then also have this GitHub workflow to release it when I press the manual button in GitHub Actions name: "Release dev container features & Generate Documentation"
on:
workflow_dispatch:
jobs:
deploy:
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
packages: write
steps:
- uses: actions/checkout@v3
- name: "Publish Features"
uses: devcontainers/action@v1
with:
publish-features: "true"
base-path-to-features: "./src"
generate-docs: "true"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} Live GitHub link to the workflow file: https://github.com/jcbhmr/devcontainer-features/blob/2bb63d027da6aab39b90f5fcfb3311f93998a3cd/.github/workflows/release.yml It is taken straight from the https://github.com/devcontainers/feature-starter/blob/0937a6939a8c9c75a54171981fb8fc169586109b/.github/workflows/release.yaml#L1-L24 so in theory it should work flawlessly... But it doesn't. I can't figure out why! Help would be appreciated. 🆘🙏 The error I get is: [[20](https://github.com/jcbhmr/devcontainer-features/actions/runs/4267540990/jobs/7429251355#step:3:21)[23](https://github.com/jcbhmr/devcontainer-features/actions/runs/4267540990/jobs/7429251355#step:3:24)-02-[25](https://github.com/jcbhmr/devcontainer-features/actions/runs/4267540990/jobs/7429251355#step:3:26)T01:03:16.234Z] Packaging feature collection...
[2023-02-25T01:03:16.237Z] Processing feature: deno...
[2023-02-25T01:03:16.253Z] Packaged 1 features!
[2023-02-25T01:03:16.254Z] Processing feature: deno...
[2023-02-25T01:03:16.254Z] Fetching published versions...
[2023-02-25T01:03:16.596Z] (!) WARNING: Version 1.0.1 already exists, skipping 1.0.1...
[2023-02-25T01:03:16.596Z] Publishing collection metadata...
[2023-02-25T01:03:16.598Z] sha256:ec9cf5ca72767dfd9aa3381cf49d52e6cb2e35ce2508356e42a17411b67cf7ec (size: 733)
[2023-02-25T01:03:16.598Z] Computed Content-Digest -> sha256:d07b9ac1728171d0dfd50c7de207bf9f1ec70b6dfb1a73448d54ee6f1a748a00 (size: 64)
[2023-02-25T01:03:16.965Z] https://ghcr.io/v2/jcbhmr/devcontainer-features/blobs/uploads/: Unexpected status code '403'
{
"errors": [
{
"code": "DENIED",
"message": "permission_denied: write_package"
}
]
}
[2023-02-25T01:03:16.965Z] Failed to get upload session ID
[2023-02-25T01:03:16.965Z] (!) ERR: Failed to publish collection metadata: devcontainer-collection.json
[2023-02-25T01:03:16.965Z] (!) ERR: Failed to publish 'ghcr.io/jcbhmr/devcontainer-features'
Error: The process '/usr/local/bin/devcontainer' failed with exit code 1
Error: (!) Failed to publish Features. Here's a link to the action workflow failure itself: https://github.com/jcbhmr/devcontainer-features/actions/runs/4267540990/jobs/7429251355 Does it have something to do with the new fancy restricted permissions that GitHub actions tokens are given? Is it an error on my end?
/related devcontainers-community/features#2 |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 3 replies
-
/cc @joshspicer @samruddhikhandale who are the experts on this Action. |
Beta Was this translation helpful? Give feedback.
-
Hi 👋
That seems about right to me, the workflow uses @jcbhmr Can you create a PAT with |
Beta Was this translation helpful? Give feedback.
-
Interesting, I had no trouble with the |
Beta Was this translation helpful? Give feedback.
-
Maybe if you do something like: name: "Release dev container features & Generate Documentation"
on:
workflow_dispatch:
jobs:
deploy:
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
permissions: write-all
# 🔺
steps:
- uses: actions/checkout@v3
- name: "Publish Features"
uses: devcontainers/action@v1
with:
publish-features: "true"
base-path-to-features: "./src"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ??? |
Beta Was this translation helpful? Give feedback.
-
In the end, I just ended up generating my repo from the feature-starter repo and resigning myself to always having the "generated by ..." blue text there. I guess it's not so bad. But yeah idk what the root cause is. Some permission thing or magic or something. |
Beta Was this translation helpful? Give feedback.
In the end, I just ended up generating my repo from the feature-starter repo and resigning myself to always having the "generated by ..." blue text there. I guess it's not so bad. But yeah idk what the root cause is. Some permission thing or magic or something.