is there such thing as user tags in Github actions...
# github-actions
p
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
r
Hmm i don't think you can access custom user attributes in github
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
You could use a gh action to ping your idp for a custom attribute and then allow or deny based on the value returned
p
I was thinking maybe at the PR level
on the payload that could be reflected
like the group the user belongs to
r
couldnt you do that with teams instead ?
p
yes you can
r
what problem are you trying to solve?
p
just an idea not a problem
take this script for example :
Copy code
#!/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%?}
do you guess what it does?
(you need bash4)
that will generate an
atlantis.yaml
file that will only contain the affected components/projects
this limits the blast radius of the user PR against other project that should not be planned at all
r
oh wow very cool
cc: @Andriy Knysh (Cloud Posse) @Erik Osterman (Cloud Posse)
p
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
it extrapolates the complexity in this case
atlantis
to have to have this guardrails and brings is back to the source …..the VCS
so not imagine this:
r
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
p
you match the user group and now you only do
Copy code
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)
yes that will be really cool feature
I requested the project name to be part of the affected Json output
I just added your suggestion
a
yes, we’ll add the atlantis project name to
atmos describe affected
- it will eliminate a lot of shell code
atmos atlantis generate repo-config --affected-only
is another feature, @PePe Amengual if you think it would be useful, please open another issue or add it to the one you already opened
p
I will open a new issue , np
a
thanks