Comments (10)
@peter-evans , So, I created the token with contents: write and now it works. Thank you. The only comment from my side that it would be good to add a comment that in some cases it will be required to specify a token even if the target workflow in the same repo. For example when the initial workflow is triggered by on.push.branches.
Thanks!
from repository-dispatch.
Just to make it crystal clear: using a fine-grained PAT to notify a different repository works.
Two people on my team (me one of them) tested this independently on two different repos.
from repository-dispatch.
@BrunoJuchli Thank you for confirming and raising a PR to update the readme.
Fine-grained PAT usage is now documented here: https://github.com/peter-evans/repository-dispatch#token
from repository-dispatch.
Are you using a fine-grained PAT? They are in beta and may not work for all GitHub APIs yet. Please try with a "classic" PAT.
(The deprecation warning is not the cause of the error)
from repository-dispatch.
I have the same issue.
- name: Trigger develop env deployment
uses: peter-evans/[email protected]
with:
event-type: develop_commit
client-payload: '{"version": "${{ steps.long_version.outputs.LONG_VERSION }}"}'
Run peter-evans/[email protected]
Error: Resource not accessible by integration
Deprecation: [@octokit/request-error]error.code
is deprecated, useerror.status
.
at RequestError.get (/home/runner/work/_actions/peter-evans/repository-dispatch/v2.1.1/dist/index.js:4221:21)
at hasErrorStatus (/home/runner/work/_actions/peter-evans/repository-dispatch/v2.1.1/dist/index.js:43:25)
at /home/runner/work/_actions/peter-evans/repository-dispatch/v2.1.1/dist/index.js:71:17
at Generator.throw ()
at rejected (/home/runner/work/_actions/peter-evans/repository-dispatch/v2.1.1/dist/index.js:32:65)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
PAT is not used because the target workflow in the same repo.
from repository-dispatch.
Hi @Sicness
Your case is different. Error: Resource not accessible by integration
often occurs when the workflow is being run in a pull request triggered by a fork. Is that how you are executing this?
When using the default GITHUB_TOKEN
in this way the maximum permission it can have is read
.
https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
from repository-dispatch.
Hi @peter-evans , thanks for the response.
The initial workflow is triggered by a push into the repo. My goal is to build the app on new commits in a branch and trigger deployment workflow from the first workflow. Looks like in that case I'll have to specify token? It's not obvious from the README :)
from repository-dispatch.
@Sicness It's difficult to say without seeing your workflow.
Are you specifying contents: write
permission for the default token in your workflow?
permissions:
contents: write
e.g. https://github.com/peter-evans/repository-dispatch/blob/main/.github/workflows/ci.yml#LL14C1-L16C18
from repository-dispatch.
Thanks adding content write fixed my fine grained token issue too
from repository-dispatch.
@peter-evans Yes, I'm using a fine-grained PAT.
from repository-dispatch.
Related Issues (20)
- Using yaml as client-payload HOT 1
- Unexpected token ' in JSON at position 0 | Multiline client_payload HOT 5
- fine-grained personal access tokens HOT 2
- Workflows not triggering when there are multiple repositories HOT 2
- Hot To Get Json From Sender to Receiver HOT 2
- Error: Resource not accessible by integration HOT 3
- Getting error (Invalid request)
- Deprecated warning when using latest version HOT 1
- how can i trigger a workflow in repo1 whenever there is commit in my other repo2 and repo3
- payload output HOT 1
- Deprecation: [@octokit/request-error] `error.code` is deprecated, use `error.status`. HOT 2
- SyntaxError: Unexpected token HOT 1
- Question: Wait and Get Workflow Output HOT 8
- Resource not accessible by integration when using GitHub App HOT 4
- Using latest 2.1.2 - workflow triggers twice. HOT 6
- Multiple event-type values in the receiving job? HOT 2
- Payload parameter HOT 1
- Usage in GitHub organizations HOT 2
- Everything good
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from repository-dispatch.