Skip to content

Conversation

@cognifloyd
Copy link
Member

@cognifloyd cognifloyd commented Dec 21, 2022

This simplifies the workflow based on my comment here: #139 (comment)

Cloning repos can be occassionally flaky. For the index, that's not an issue because we do it so often, that waiting a few more minutes for the next run doesn't really matter. For this workflow, I would like to avoid cloning the pack repos somehow, so that this can be more reliable.

And it switches from gh workflow to gh api so that we can use fine-grained PATs.

@cognifloyd
Copy link
Member Author

@mamercad and @armab wdyt?

@cognifloyd cognifloyd changed the title Enable pack "Build and Test" workflow without cloning Enable pack "Build and Test" workflow without cloning && enable using fine-grained PAT Dec 21, 2022
@cognifloyd
Copy link
Member Author

The last commit I added should, I hope, allow us to use a fine-grained PAT with this. I ran into some permissions issues with the bot token I created:
https://github.com/StackStorm-Exchange/ci/actions/runs/3746070101/jobs/6361092828#step:6:69

  failed to enable workflow: HTTP 403: Must have admin rights to Repository. (https://api.github.com/repos/StackStorm-Exchange/stackstorm-acos/actions/workflows/16569224/enable)

But, as @mamercad noticed, graphql doesn't work with a fine-grained PAT, and gh workflow apparently is using graphql. 🤦
https://github.com/StackStorm-Exchange/ci/actions/runs/3746417874/jobs/6361741025#step:6:59

gh: Personal access tokens with fine grained access do not support the GraphQL API (HTTP 401)

gh api explicitly does not use graphql. So, I'm hoping this will resolve those issues.

The fine-grained PAT must have an expiration date, so we will have to manually rotate this secret occasionally.

@mamercad
Copy link
Contributor

@mamercad and @armab wdyt?

Looks good to me!

Copy link
Member

@arm4b arm4b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the enhancement with simplified approach overall 👍

@cognifloyd cognifloyd merged commit 4820c73 into master Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants