#github-actions (2023-01)

Discussions related to GitHub Actions

2023-01-04

2023-01-10

actions Archives | The GitHub Blog avatar
actions Archives | The GitHub Blog
12:15:42 AM

GitHub Actions: OpenID Connect token now supports more claims for configuring granular cloud access GitHub Actions: OpenID Connect token now supports more claims for configuring granular cloud access

GitHub Actions: OpenID Connect token now supports more claims for configuring granular cloud access | GitHub Changelogattachment image

GitHub Actions: OpenID Connect token now supports more claims for configuring granular cloud access

2023-01-11

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
Drift Detection with Github Actions

Overview It’s Friday at 5PM and an urgent request comes in from the Chief Infotainment Officer. You know exactly what you have to update in terraform and create a new feature branch to make the changes. You’re rolling through the lower environments and finally get to production. You run a terraform plan and unexpected resource deletions show up in the output. You panic a little, then realize that your work didn’t trigger the deletion.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

cc @matt

Drift Detection with Github Actions

Overview It’s Friday at 5PM and an urgent request comes in from the Chief Infotainment Officer. You know exactly what you have to update in terraform and create a new feature branch to make the changes. You’re rolling through the lower environments and finally get to production. You run a terraform plan and unexpected resource deletions show up in the output. You panic a little, then realize that your work didn’t trigger the deletion.

RB avatar

@jose.amengual

jose.amengual avatar
jose.amengual

yes, I gave it a read

jose.amengual avatar
jose.amengual

I think is a very simplistic “good enough” solution with no feedback loops except for some task status etc

jose.amengual avatar
jose.amengual

in my opinion Drift detection should have an option to have more detail and historical reference of what happened etc

jose.amengual avatar
jose.amengual

so in a GitOps scenario you should be able to see what happened and hopefully that is recorded in the repo too

Joe Perez avatar
Joe Perez

yeah, I kinda kept it open ended with the alerting mechanism on this article. Slack, email, etc. For something more in-depth, I would use a dedicated tool, but I think for a lot of people, this and possibly cloudtrail should be a good start. Also having strict rules on how terraform code is promoted through environments should help eliminate drift

jose.amengual avatar
jose.amengual

totally, your article is pretty good , and for most people this is more than enough for sure

1
jose.amengual avatar
jose.amengual

Where I come from if from the Atlantis side ( I’m a Maintainer) and I just implemented a github action workflow similar to what you propose in the article but for a tool that already does GitOps the github action user workflow is not the best to go about it and makes unnecessary steps to be needed for implementation

jose.amengual avatar
jose.amengual

Ideally the GitOps tool ( Atlantis, spacelift, TFC) should communicate back through more than one channel

1
jose.amengual avatar
jose.amengual

and in case of finding drift it should report back in or leave a trail of what it did if autoremediation was done, in form of a ticket, PR or whatever

jose.amengual avatar
jose.amengual

and hopefully the GitOps tools can have and /api/drift than can be trigger by a simple workflow(not github specific) or support multiple VCSs too

Joe Perez avatar
Joe Perez

yeah, I guess hoping what’s committed to main is the desired state and if the drift is too destructive, then maybe triggering an escalation for human review

jose.amengual avatar
jose.amengual

correct

2023-01-12

jose.amengual avatar
jose.amengual

is there such thing as user tags in Github actions? like a user can have a tag called prod that then is used to filter PR against a prod environment etc

RB avatar

Hmm i don’t think you can access custom user attributes in github

RB avatar

If you could, i imagine that would be through gh enterprise with a saml sso setup but even then i don’t think gh actions would have that granularity out of the box

RB avatar

You could use a gh action to ping your idp for a custom attribute and then allow or deny based on the value returned

jose.amengual avatar
jose.amengual

I was thinking maybe at the PR level

jose.amengual avatar
jose.amengual

on the payload that could be reflected

jose.amengual avatar
jose.amengual

like the group the user belongs to

RB avatar

couldnt you do that with teams instead ?

jose.amengual avatar
jose.amengual

yes you can

RB avatar

what problem are you trying to solve?

jose.amengual avatar
jose.amengual

just an idea not a problem

jose.amengual avatar
jose.amengual

take this script for example :

#!/usr/bin/env bash
atmos describe affected --ref refs/heads/main --file affected.json
stacks=""
components=""
for s in `jq -cr '.[]|.stack' affected.json|uniq`; do stacks+="${s},"; done
for c in `jq -cr '.[]|.component' affected.json|uniq`; do components+="${c},"; done

echo ${stacks%?}
echo ${components%?}


atmos atlantis generate repo-config --config-template config-1 --project-template project-1 --workflow-template workflow-1 --stacks ${stacks%?} --components ${components%?}
jose.amengual avatar
jose.amengual

do you guess what it does?

jose.amengual avatar
jose.amengual

(you need bash4)

jose.amengual avatar
jose.amengual

that will generate an atlantis.yaml file that will only contain the affected components/projects

jose.amengual avatar
jose.amengual

this limits the blast radius of the user PR against other project that should not be planned at all

RB avatar

oh wow very cool

RB avatar

cc: @Andriy Knysh (Cloud Posse) @Erik Osterman (Cloud Posse)

jose.amengual avatar
jose.amengual

so the user can go in and do atlantis plan -p myproject or have autoplan enabled and it will only plan the stuff that pretends to the PR, do you see how powerful this is?

1
jose.amengual avatar
jose.amengual

it extrapolates the complexity in this case atlantis to have to have this guardrails and brings is back to the source …..the VCS

jose.amengual avatar
jose.amengual

so not imagine this:

RB avatar

it might be a good feature request to create the atlantis.yaml file for only stacks/components affected so you do not need to run the custom shell script e.g. atmos atlantis generate repo-config --affected

jose.amengual avatar
jose.amengual

you match the user group and now you only do

for s in `jq -cr '.[]|.stack' affected.json|uniq`; do if [ $s == “.*-prod”]; then stacks+=“${s},” fi; done

( I think the syntax is wrong but you get the idea)

jose.amengual avatar
jose.amengual

yes that will be really cool feature

jose.amengual avatar
jose.amengual

I requested the project name to be part of the affected Json output

jose.amengual avatar
jose.amengual
#294 `atmos describe affected` does not show the project name if the atlantis integration is enabled

Describe the Feature

Add integrations to the output of the atmos describe affected

Expected Behavior

When I run :

atmos describe affected --ref refs/heads/main --verbose=true

the output is:

   {
      "stack": "pepe-ue2-lab",
      "component_type": "terraform",
      "component": "vpc",
      "affected": "stack.vars"
   }
]

if atlantis integration is enabled it will be useful to have the project name added to the output like :+1::skin-tone-4:

   {
      "stack": "pepe-ue2-lab",
      "component_type": "terraform",
      "component": "vpc",
      "affected": "stack.vars"
      "atlantis_project_name": "pepe-ue2-lab-vpc"
   }
]

Use Case

since Atlantis supports dynamically generated atlantis.yaml files it is possible to generate an atlantis.yaml for only the affected component/s and this way limit the blast radius of a PR significantly.

Alternatives Considered

parsing yaml until is not fun anymore….

jose.amengual avatar
jose.amengual

I just added your suggestion

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

yes, we’ll add the atlantis project name to atmos describe affected - it will eliminate a lot of shell code

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

atmos atlantis generate repo-config --affected-only is another feature, @jose.amengual if you think it would be useful, please open another issue or add it to the one you already opened

jose.amengual avatar
jose.amengual

I will open a new issue , np

jose.amengual avatar
jose.amengual
#303 implement atmos atlantis generate repo-config --affected-only

Have a question? Please checkout our Slack Community or visit our Slack Archive.

Slack Community

Describe the Feature

it will very useful to expand the atmos describe affected to the Atlantis integration to be able to generate an atlantis.yaml file of only the affected components instead of all the components.

this will be useful to limit the blast radius of possible changes a user can trigger in an attlantis project.

Expected Behavior

atmos atlantis generate repo-config --affected-only --ref refs/heads/main should only generate the atlantis.yaml file base on the branch specified.

Use Case

limit the blast radius of possible changes a user can trigger in an attlantis project.

Alternatives Considered

#!/usr/bin/env bash
atmos describe affected --ref refs/heads/main --file affected.json
stacks=""
components=""
for s in `jq -cr '.[]|.stack' affected.json|uniq`; do stacks+="${s},"; done
for c in `jq -cr '.[]|.component' affected.json|uniq`; do components+="${c},"; done

echo ${stacks%?}
echo ${components%?}

atmos atlantis generate repo-config --config-template config-1 --project-template project-1 --workflow-template workflow-1 --stacks ${stacks%?} --components ${components%?}

Additional Context

(#294)

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

thanks

2023-01-16

deniz gökçin avatar
deniz gökçin

Hi all!!

We are on GitHub Teams plan and I was wondering how are the folks here handling shared-actions. I have some workflows that are identical in all repos and I have some workfows that have minor differences in different repos. Although I am using dependabot to handle version bumps, it started to be super painful to update 30+ repos whenever I think of an enhancement. Any tips??

Thanks

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

good #office-hours question

Darren Cunningham avatar
Darren Cunningham
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

note this is for GitHub Enterprise only

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

or so I thought…

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Actually, I can’t find mention that it’s enterprise only.

Darren Cunningham avatar
Darren Cunningham

the roadmap issue is tagged cloud

1

2023-01-17

actions Archives | The GitHub Blog avatar
actions Archives | The GitHub Blog
05:45:36 PM

Push Notifications for Actions on Mobile Push Notifications for Actions on Mobile

Push Notifications for Actions on Mobile | GitHub Changelogattachment image

Push Notifications for Actions on Mobile

2023-01-18

managedkaos avatar
managedkaos

Is it just me or has this workflow been running for more than 1 year? https://github.com/NTTDATA-EMEA/viewnode/actions/runs/1470423403/jobs/1909240965

Darren Cunningham avatar
Darren Cunningham

all for a README update

1
Darren Cunningham avatar
Darren Cunningham

I submitted a support request

1
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Guessing the repo was archived while the build was running. Once archived, the repo state is readonly and the state couldn’t be updated.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)


This repository has been archived by the owner before Nov 8, 2022. It is now read-only.

Darren Cunningham avatar
Darren Cunningham


Thank you for contacting GitHub Support.
I took a look at the affected run. It seems the repository was archived before the push that triggered that workflow hence it stayed in a pending state.
This will not affect the billing since the repository has been archived by the owner.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Ya, makes sense

2023-01-19

2023-01-20

2023-01-27

Steve Wade (swade1987) avatar
Steve Wade (swade1987)

What GH action are people using instead of gitleaks? I can’t justify the license cost for our 200+ repos

RB avatar

I didn’t know gitleaks costs money

RB avatar

I’ve used gitleaks locally and haven’t used their action. I never had to pay for it tho

akhan4u avatar
akhan4u

Are you using it as a pre-commit hook?

Jim Park avatar
Jim Park

GitHub has a paid feature for secret scanning, but it too costs money.

Jim Park avatar
Jim Park

In my Pivotal days, we wrote our own open-source credential scanner.

It’s effectively unmaintained, the last release was over a year ago. However, if you’re keen, it may serve as an inspiration for your own project.

1
Pawel Rein avatar
Pawel Rein

did any of you came across a tool that scans GHA artifacts and logs?

2023-01-29

2023-01-31

actions Archives | The GitHub Blog avatar
actions Archives | The GitHub Blog
08:05:36 PM

GitHub Actions: Job summary updates GitHub Actions: Job summary updates

    keyboard_arrow_up