#GitHub Actions - Can I push to private repo (ghcr) without creating a PAT?
1 messages · Page 1 of 1 (latest)
hey @fresh magnet ! by GH_TOKEN do you mean the GITHUB_TOKEN? https://docs.github.com/en/actions/security-guides/automatic-token-authentication?
you can setup the pipeline in a way that when you running locally it uses the PAT and when you run it in Github Actions, make it use the GITHUB_TOKEN
Hey! wow!
It is working now
I had to add the repo to the package. This is an additional step you gotta do apparently. Before this I was hitting "403 Forbidden" errors.
name: dagger_demo.yaml
permissions:
contents: read
packages: write
on:
push:
branches:
- demo
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 'Install dagger-io'
run: pip install dagger-io
- name: 'Run Dagger pipeline'
uses: dagger/dagger-for-github@v5
with:
workdir: apps/demo
verb: run
args: python main.py "${{ secrets.GITHUB_TOKEN }}" "${{ github.actor }}"
version: "0.9.3"
``` * updated based on comments below
Thank you for your help! @ivory marten ! i'm happy to know that there is a way to do this!
that's great! happy hacking and we're here to help in any way we can! 💪 
Awesome! I'm thinking that you can simplify this line
run: cd /usr/local && { curl -L https://dl.dagger.io/dagger/install.sh | sh; cd -; } && pip install anyio && pip install dagger-io
to (updated based on comment below 🙏 )
pip install dagger-io
since the dagger/dagger-for-github action installs the CLI for you.
Also I think installing anyio is not required since the Dagger SDK already requires it
also, seems like setup-go is irrelevant there?
Many thanks @mortal bloom @ivory marten, 🙏 I have updated the code based on your comments. It still works fine! 🤗