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

List trusted workflows initialised by dependabot in PR checks #4305

Closed
ashlinchak opened this issue Oct 11, 2021 · 4 comments
Closed

List trusted workflows initialised by dependabot in PR checks #4305

ashlinchak opened this issue Oct 11, 2021 · 4 comments
Labels
service 💁 Relates to Dependabot features GitHub provides T: feature-request Requests for new features

Comments

@ashlinchak
Copy link

In our organisation, we're using environment variables for accessing private packages and make Docker container builds as a part of CI checks. According to the latest changes with decreasing level of accessibility for dependabot now it's not possible to build the right workflow for PRs which are created by dependabot.

With the newest changes, dependabot can't get secrets on push and pull_request events, which we're using for our CI checks. According to this documentation, we're forced to create 2 workflows, e.g.:

name: Dependabot Push Check
on:
  push:
jobs:
  check_dependabot:
    runs-on: ubuntu-latest
    if: ${{ github.actor == 'dependabot[bot]' }}
    steps:
      - run: echo "Push initiated by Dependabot"
name: Dependabot Trusted Workflow
on:
  workflow_run:
    workflows:
      - Dependabot Push Check
    types:
      - completed
jobs:
  dependabot:
    runs-on: ubuntu-latest
    if: ${{ github.event.workflow_run.conclusion == 'success' }}
    steps:
      - name: Check out repository code
        uses: actions/checkout@v2
      - name: Run tests
        run: npm test
        env:
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

When depenedabot creates its PR, it'll have only 1 check in it:
Screenshot 2021-10-11 at 14 26 01

Dependabot Push Check workflow triggers Dependabot Trusted Workflow but the last one is not part of CI checks for the PR.

Could we implement the feature where we could specify that the workflow is a part of PR checks?

Also, in our case, we need to have Dependabot Trusted Workflow workflow to be part of checks for PRs initialized not only dependabot but regular developers.

@ashlinchak ashlinchak added the T: feature-request Requests for new features label Oct 11, 2021
@jurre
Copy link
Member

jurre commented Oct 11, 2021

I believe your setup can be simplified with this recent change: https://github.blog/changelog/2021-10-06-github-actions-workflows-triggered-by-dependabot-prs-will-respect-permissions-key-in-workflows/, that should allow to to specify the needed permissions in a single workflow.

@ashlinchak
Copy link
Author

@jurre Thank you for your response, this is great news around permissions. Could you please suggest how we could fix our workflow as the main issue for us is unable to get secrets for CI job which was triggered by dependabot?

According to provided by you link, this is still in progress:

In addition to the permissions change we are working to enable workflows triggered by Dependabot to use Dependabot secrets. This change will enable you to use those secrets to pull dependencies from private repositories.

@brrygrdn brrygrdn added the service 💁 Relates to Dependabot features GitHub provides label Nov 26, 2021
@brrygrdn
Copy link
Contributor

According to provided by you link, this is still in progress:

Unfortunately I don't have an ETA to share on shipping this change, but this is being actively worked on.

@jeffwidman
Copy link
Member

I'm fairly sure this is the same underlying issue as:

So closing as a duplicate. If I'm misunderstanding something, please comment and we can reopen.

@jeffwidman jeffwidman closed this as not planned Won't fix, can't repro, duplicate, stale Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service 💁 Relates to Dependabot features GitHub provides T: feature-request Requests for new features
Projects
None yet
Development

No branches or pull requests

4 participants