Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

starter-workflow template gives Resource not accessible by integration #12

Closed
msamprz opened this issue Aug 26, 2019 · 80 comments · Fixed by ethereum/ethereum-org-website#345 or canonical/maas-ui#346

Comments

@msamprz
Copy link

msamprz commented Aug 26, 2019

Hi there,

I've implemented the exact Labeler workflow as the starter-workflow template in the dir path .github/workflows/label.yml.

I have also added the .github/labeler.yml file with the configuration below:

Trader: packages/trader/**/*

Bot: packages/bot/**/*

Core: packages/core/**/*

Components: packages/components/**/*

Shared: packages/shared/**/*

The action is recognised and runs on PR, however the Labeler action resolves with the following error:

##[error]HttpError: Resource not accessible by integration
##[error]Resource not accessible by integration
##[error]Node run failed with exit code 1

Googling seems to relate that error with invalid access to the repo by the action app, so I thought I'd create an issue and disable the action for now, but would be happy to know if there's something I have missed out that will be able to solve this issue for me.

Thanks.

@damccorm
Copy link
Contributor

Hm, haven't seen that before. Are you able to share your repo by chance (or just the relevant pieces)?

@msamprz
Copy link
Author

msamprz commented Aug 27, 2019

Hey @damccorm, thanks for the response.
Yes, sure. The repo is over at github.com/binary-com/deriv-app. Although due to the failing action, we have currently disabled it, but you can find the PR that enabled Labeler here, and an example of a failed run here.

@damccorm
Copy link
Contributor

damccorm commented Aug 27, 2019

Hm, so it looks like this is an issue with forks:
works fine on my branch
fails on fork

I'll reach out internally and figure out if that's expected scoping of permissions for the GITHUB_TOKEN and we can go from there

@squidsoup
Copy link

I just submitted a support ticket about this, but probably should have checked here first! thanks @damccorm

@damccorm
Copy link
Contributor

So it turns out that this is working as intended after all. We can't give write permissions to forks for security reasons (e.g. the forked user changes your yaml file to write bad things to your repo), so this should fail on forks.

With that said, the docs are wrong here and need to be updated. Already added actions/starter-workflows#78 to update the template, will also follow up to update docs here.

@msamprz
Copy link
Author

msamprz commented Aug 29, 2019

Thanks for investigating, @damccorm. And the update seems like a good alternative for my use at least. Others can reopen this if necessary, but I'll close it as it's expected behavior.

Just pinging you, @squidsoup to loop you in.

@damccorm
Copy link
Contributor

I spoke too soon. Switching this to cron by itself won't work because we assume its going to be run on a PR. Trying to figure out what makes the most sense here. Option 1 is to just not add labels to forks (but we shouldn't throw like we do now regardless). Option 2 is to update it to filter through all pull requests.

In theory I like option 2, but we need to be careful or we'll get rate limited - along those lines, we need a way of skipping PRs that we've already processed - maybe we could add a "triaged" label or something, but that's kind of ugly.

Thoughts? My instinct is to start with option 1 - better error handling on forks - and then move on to option 2 as appropriate

@squidsoup
Copy link

@damccorm option 2 certainly sounds far more useful for us - our workflow has every developer on our project making PRs from their forks (and presumably that's a fairly common workflow).

@NobbZ
Copy link

NobbZ commented Sep 3, 2019

Option 1 makes this action useless, as whoever who has write access can put the labels themselves as necessary, though in a repo with 90 percent or more contribution through forks, we really wanted to use this action to reduce manual work.

Why can't you just use the default branches labeler.yml as canonical config?

@damccorm
Copy link
Contributor

damccorm commented Sep 3, 2019

Yeah, agreed option 2 makes a lot more sense.

Why can't you just use the default branches labeler.yml as canonical config?

The issue isn't getting the labeler.yml, the issue here is that workflows that run on forks don't have write permissions (so they can't create labels)

@iHiD
Copy link

iHiD commented Sep 3, 2019

Could we change the config to use the repo's token, rather than the fork's token? If this works conceptually, we (exercism pps) could experiment more.

NobbZ added a commit to exercism/website-copy that referenced this issue Sep 3, 2019
Disable the workflow until a solution to actions/labeler#12 has been found.

After the linked issue has been solved, we probably need to also bump the version of the action.
@ibakshay
Copy link

Hello @damccorm, Is there any way or workaround to trigger the action on the base repository so that the GitHub Action token will have both read/write access when there is a PR from the forked repository. And there is no need to re-write the whole code base.

This was referenced Oct 3, 2019
@GregTheGreek
Copy link

What is the end solution?

SubhrajitPrusty added a commit to SubhrajitPrusty/wallgen that referenced this issue Oct 4, 2019
doesn't work on forks : actions/labeler#12
SubhrajitPrusty added a commit to SubhrajitPrusty/codex-github that referenced this issue Oct 4, 2019
doesn't work on forks : actions/labeler#12
@pedronastasi
Copy link

pedronastasi commented Nov 29, 2022

Apparently, GitHub is treating dependabot prs like forks. Here is the related article. As @TobKed has suggested, I used the following snippet on the top level of my workflow to grant the needed permissions. So thank you very much.

permissions:
  # All other permissions are set to none
  checks: write
  contents: read
  pull-requests: write

Additional question to @TobKed assuming that the repository will always be private and I will only use dependabot to update private submodules that my repository is dependent to, do you think it is also possible/safe to use pull_request_target as my event trigger without adding any permissions like you have suggested?

pull_request_target is not safe and not recommended at all as it compares all the changes against master, which makes the tests unreliable.

chormaz added a commit to equinor/procosys-js-frontend that referenced this issue Sep 12, 2023
chormaz added a commit to equinor/procosys-js-frontend that referenced this issue Sep 12, 2023
* Bump node from 14.17.0 to 20.2.0 in /.docker

Bumps node from 14.17.0 to 20.2.0.

---
updated-dependencies:
- dependency-name: node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* give permissions to labeler-action ref:actions/labeler#12

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Christian Alejandro Hormazabal Martin <chorm@equinor.com>
chormaz added a commit to equinor/procosys-js-frontend that referenced this issue Sep 13, 2023
* Bump node from 14.17.0 to 20.2.0 in /.docker

Bumps node from 14.17.0 to 20.2.0.

---
updated-dependencies:
- dependency-name: node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* give permissions to labeler-action ref:actions/labeler#12

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Christian Alejandro Hormazabal Martin <chorm@equinor.com>
chormaz added a commit to equinor/procosys-js-frontend that referenced this issue Sep 13, 2023
* Bump qs from 6.11.0 to 6.11.2

Bumps [qs](https://github.com/ljharb/qs) from 6.11.0 to 6.11.2.
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](ljharb/qs@v6.11.0...v6.11.2)

---
updated-dependencies:
- dependency-name: qs
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* feature/80600-IPO-ønsker-mc-pakke-status-i-selected-scope-info (#766)

* Added m1, m02 info + status to selected scope info

* removed logging

* Formatted the date

* Feature/104582 handle scope handed over status (#768)

* Added ScopeHandedOver enumm and added to filter

* Unable to edit when scope handed over

* Removed step created when handed over

* Cannot edit when scope handed over

* Renamed files

* Improve readability for ScopeHandedOver status in search IPO

* Rename

* Allow admin to delete IPOs with status ScopeHandedOver

---------

Co-authored-by: VRiveland <vriv@equinor.com>

* Feature/104099 ipo lage knapp for å opprette teamsmøte innkallelse frontend (#767)

* Added checkbox in invitation to make teamsmeeting

* fixed warning with EdsIcon inside button

* changed back to edsIcon

* Show teamsmeeting as checked on editview

* Addes styling to teams meeting checkbox

* Changed how teams meeting is shown in view IPO

* Changed wording in create IPO

* Small changes

---------

Co-authored-by: VRiveland <vriv@equinor.com>

* Feature/80834 UI disable mc pkgs with signed rfoc (#769)

* Added     operationHandoverStatus on types

* set disableCheckbox to true

* Disabled checkbox doesnt get selected on selectall

* New column in table with checkbox if rfoc accepted

* Fixed check all not working properly

* Moved RFOC column to before MC column in DP comm table

* Disabling MCpkg column i comm table when RFOC is accepted

* Removed disabling MC button when RFOC has status accepted

---------

Co-authored-by: VRiveland <vriv@equinor.com>

* docs(readme): remove white spaces to trigger build

* fix: package.json & yarn.lock to reduce vulnerabilities (#765)

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-SEMVER-3247795

Co-authored-by: snyk-bot <snyk-bot@snyk.io>

* Revert "fix: package.json & yarn.lock to reduce vulnerabilities (#765)" (#775)

This reverts commit 63d8e17.

* Bump node from 14.17.0 to 20.2.0 in /.docker (#759)

* Bump node from 14.17.0 to 20.2.0 in /.docker

Bumps node from 14.17.0 to 20.2.0.

---
updated-dependencies:
- dependency-name: node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* give permissions to labeler-action ref:actions/labeler#12

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Christian Alejandro Hormazabal Martin <chorm@equinor.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: AnneSkje <114983853+AnneSkje@users.noreply.github.com>
Co-authored-by: VRiveland <vriv@equinor.com>
Co-authored-by: Kristoffer Steen <KRST@equinor.com>
Co-authored-by: Kristoffer Steen <kristoffer.steen@hotmail.com>
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: Christian Hormazabal <78788930+chormaz@users.noreply.github.com>
Co-authored-by: Christian Alejandro Hormazabal Martin <chorm@equinor.com>
chormaz added a commit to equinor/procosys-js-frontend that referenced this issue Sep 13, 2023
* Bump node from 14.17.0 to 20.2.0 in /.docker

Bumps node from 14.17.0 to 20.2.0.

---
updated-dependencies:
- dependency-name: node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* give permissions to labeler-action ref:actions/labeler#12

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Christian Alejandro Hormazabal Martin <chorm@equinor.com>
chormaz added a commit to equinor/procosys-js-frontend that referenced this issue Sep 13, 2023
* Bump qs from 6.11.0 to 6.11.2

Bumps [qs](https://github.com/ljharb/qs) from 6.11.0 to 6.11.2.
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](ljharb/qs@v6.11.0...v6.11.2)

---
updated-dependencies:
- dependency-name: qs
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* feature/80600-IPO-ønsker-mc-pakke-status-i-selected-scope-info (#766)

* Added m1, m02 info + status to selected scope info

* removed logging

* Formatted the date

* Feature/104582 handle scope handed over status (#768)

* Added ScopeHandedOver enumm and added to filter

* Unable to edit when scope handed over

* Removed step created when handed over

* Cannot edit when scope handed over

* Renamed files

* Improve readability for ScopeHandedOver status in search IPO

* Rename

* Allow admin to delete IPOs with status ScopeHandedOver

---------

Co-authored-by: VRiveland <vriv@equinor.com>

* Feature/104099 ipo lage knapp for å opprette teamsmøte innkallelse frontend (#767)

* Added checkbox in invitation to make teamsmeeting

* fixed warning with EdsIcon inside button

* changed back to edsIcon

* Show teamsmeeting as checked on editview

* Addes styling to teams meeting checkbox

* Changed how teams meeting is shown in view IPO

* Changed wording in create IPO

* Small changes

---------

Co-authored-by: VRiveland <vriv@equinor.com>

* Feature/80834 UI disable mc pkgs with signed rfoc (#769)

* Added     operationHandoverStatus on types

* set disableCheckbox to true

* Disabled checkbox doesnt get selected on selectall

* New column in table with checkbox if rfoc accepted

* Fixed check all not working properly

* Moved RFOC column to before MC column in DP comm table

* Disabling MCpkg column i comm table when RFOC is accepted

* Removed disabling MC button when RFOC has status accepted

---------

Co-authored-by: VRiveland <vriv@equinor.com>

* docs(readme): remove white spaces to trigger build

* fix: package.json & yarn.lock to reduce vulnerabilities (#765)

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-SEMVER-3247795

Co-authored-by: snyk-bot <snyk-bot@snyk.io>

* Revert "fix: package.json & yarn.lock to reduce vulnerabilities (#765)" (#775)

This reverts commit 63d8e17.

* Bump node from 14.17.0 to 20.2.0 in /.docker (#759)

* Bump node from 14.17.0 to 20.2.0 in /.docker

Bumps node from 14.17.0 to 20.2.0.

---
updated-dependencies:
- dependency-name: node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* give permissions to labeler-action ref:actions/labeler#12

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Christian Alejandro Hormazabal Martin <chorm@equinor.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: AnneSkje <114983853+AnneSkje@users.noreply.github.com>
Co-authored-by: VRiveland <vriv@equinor.com>
Co-authored-by: Kristoffer Steen <KRST@equinor.com>
Co-authored-by: Kristoffer Steen <kristoffer.steen@hotmail.com>
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: Christian Hormazabal <78788930+chormaz@users.noreply.github.com>
Co-authored-by: Christian Alejandro Hormazabal Martin <chorm@equinor.com>
chormaz added a commit to equinor/procosys-js-frontend that referenced this issue Sep 13, 2023
* Bump nginx from 1.21.6-alpine to 1.25.0-alpine in /.docker

Bumps nginx from 1.21.6-alpine to 1.25.0-alpine.

---
updated-dependencies:
- dependency-name: nginx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* feature/80600-IPO-ønsker-mc-pakke-status-i-selected-scope-info (#766)

* Added m1, m02 info + status to selected scope info

* removed logging

* Formatted the date

* Feature/104582 handle scope handed over status (#768)

* Added ScopeHandedOver enumm and added to filter

* Unable to edit when scope handed over

* Removed step created when handed over

* Cannot edit when scope handed over

* Renamed files

* Improve readability for ScopeHandedOver status in search IPO

* Rename

* Allow admin to delete IPOs with status ScopeHandedOver

---------

Co-authored-by: VRiveland <vriv@equinor.com>

* Feature/104099 ipo lage knapp for å opprette teamsmøte innkallelse frontend (#767)

* Added checkbox in invitation to make teamsmeeting

* fixed warning with EdsIcon inside button

* changed back to edsIcon

* Show teamsmeeting as checked on editview

* Addes styling to teams meeting checkbox

* Changed how teams meeting is shown in view IPO

* Changed wording in create IPO

* Small changes

---------

Co-authored-by: VRiveland <vriv@equinor.com>

* Feature/80834 UI disable mc pkgs with signed rfoc (#769)

* Added     operationHandoverStatus on types

* set disableCheckbox to true

* Disabled checkbox doesnt get selected on selectall

* New column in table with checkbox if rfoc accepted

* Fixed check all not working properly

* Moved RFOC column to before MC column in DP comm table

* Disabling MCpkg column i comm table when RFOC is accepted

* Removed disabling MC button when RFOC has status accepted

---------

Co-authored-by: VRiveland <vriv@equinor.com>

* docs(readme): remove white spaces to trigger build

* fix: package.json & yarn.lock to reduce vulnerabilities (#765)

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-SEMVER-3247795

Co-authored-by: snyk-bot <snyk-bot@snyk.io>

* Revert "fix: package.json & yarn.lock to reduce vulnerabilities (#765)" (#775)

This reverts commit 63d8e17.

* Bump node from 14.17.0 to 20.2.0 in /.docker (#759)

* Bump node from 14.17.0 to 20.2.0 in /.docker

Bumps node from 14.17.0 to 20.2.0.

---
updated-dependencies:
- dependency-name: node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* give permissions to labeler-action ref:actions/labeler#12

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Christian Alejandro Hormazabal Martin <chorm@equinor.com>

* Bump qs from 6.11.0 to 6.11.2 (#761)

* Bump qs from 6.11.0 to 6.11.2

Bumps [qs](https://github.com/ljharb/qs) from 6.11.0 to 6.11.2.
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](ljharb/qs@v6.11.0...v6.11.2)

---
updated-dependencies:
- dependency-name: qs
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* feature/80600-IPO-ønsker-mc-pakke-status-i-selected-scope-info (#766)

* Added m1, m02 info + status to selected scope info

* removed logging

* Formatted the date

* Feature/104582 handle scope handed over status (#768)

* Added ScopeHandedOver enumm and added to filter

* Unable to edit when scope handed over

* Removed step created when handed over

* Cannot edit when scope handed over

* Renamed files

* Improve readability for ScopeHandedOver status in search IPO

* Rename

* Allow admin to delete IPOs with status ScopeHandedOver

---------

Co-authored-by: VRiveland <vriv@equinor.com>

* Feature/104099 ipo lage knapp for å opprette teamsmøte innkallelse frontend (#767)

* Added checkbox in invitation to make teamsmeeting

* fixed warning with EdsIcon inside button

* changed back to edsIcon

* Show teamsmeeting as checked on editview

* Addes styling to teams meeting checkbox

* Changed how teams meeting is shown in view IPO

* Changed wording in create IPO

* Small changes

---------

Co-authored-by: VRiveland <vriv@equinor.com>

* Feature/80834 UI disable mc pkgs with signed rfoc (#769)

* Added     operationHandoverStatus on types

* set disableCheckbox to true

* Disabled checkbox doesnt get selected on selectall

* New column in table with checkbox if rfoc accepted

* Fixed check all not working properly

* Moved RFOC column to before MC column in DP comm table

* Disabling MCpkg column i comm table when RFOC is accepted

* Removed disabling MC button when RFOC has status accepted

---------

Co-authored-by: VRiveland <vriv@equinor.com>

* docs(readme): remove white spaces to trigger build

* fix: package.json & yarn.lock to reduce vulnerabilities (#765)

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-SEMVER-3247795

Co-authored-by: snyk-bot <snyk-bot@snyk.io>

* Revert "fix: package.json & yarn.lock to reduce vulnerabilities (#765)" (#775)

This reverts commit 63d8e17.

* Bump node from 14.17.0 to 20.2.0 in /.docker (#759)

* Bump node from 14.17.0 to 20.2.0 in /.docker

Bumps node from 14.17.0 to 20.2.0.

---
updated-dependencies:
- dependency-name: node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* give permissions to labeler-action ref:actions/labeler#12

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Christian Alejandro Hormazabal Martin <chorm@equinor.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: AnneSkje <114983853+AnneSkje@users.noreply.github.com>
Co-authored-by: VRiveland <vriv@equinor.com>
Co-authored-by: Kristoffer Steen <KRST@equinor.com>
Co-authored-by: Kristoffer Steen <kristoffer.steen@hotmail.com>
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: Christian Hormazabal <78788930+chormaz@users.noreply.github.com>
Co-authored-by: Christian Alejandro Hormazabal Martin <chorm@equinor.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: AnneSkje <114983853+AnneSkje@users.noreply.github.com>
Co-authored-by: VRiveland <vriv@equinor.com>
Co-authored-by: Kristoffer Steen <KRST@equinor.com>
Co-authored-by: Kristoffer Steen <kristoffer.steen@hotmail.com>
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: Christian Hormazabal <78788930+chormaz@users.noreply.github.com>
Co-authored-by: Christian Alejandro Hormazabal Martin <chorm@equinor.com>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet