#github-actions (2024-10)

Discussions related to GitHub Actions

2024-10-01

actions - GitHub Changelog avatar
actions - GitHub Changelog
07:25:34 PM

Repository level Actions Usage Metrics – public preview Repository level Actions Usage Metrics - public preview The post Repository level Actions Usage Metrics – public preview appeared first on The GitHub Blog.

Repository level Actions Usage Metrics – public preview · GitHub Changelogattachment image

Repository level Actions Usage Metrics - public preview

Homeattachment image

Updates, ideas, and inspiration from GitHub to help developers build and design software.

actions - GitHub Changelog avatar
actions - GitHub Changelog
07:45:34 PM

Annotations in the GitHub Actions log view Annotations in the GitHub Actions log view The post Annotations in the GitHub Actions log view appeared first on The GitHub Blog.

Annotations in the GitHub Actions log view · GitHub Changelogattachment image

Annotations in the GitHub Actions log view

2024-10-04

RB avatar

Thoughts on this proposal to skip specific commits using a skip ci message or PRs using a PR label for the cloudposse precommit action ?

https://github.com/cloudposse/github-action-pre-commit/issues/28

#28 Ability to skip pre-commit on specific commits or PRs

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

Slack Community

Describe the Feature

It would be nice to skip the pre-commit for a PR, perhaps using a PR label
It would be nice to skip the pre-commit for a commit message, perhaps using skip ci or similar

There is no way to use a native way in pre-commit to skip hooks on a specific commit message such as using skip ci. See pre-commit/pre-commit#2806.

Expected Behavior

An easy way to skip pre-commit per commit or per PR.

Usually this comes up if there is a special edge case where you need something done without one of pre-commit’s hooks getting in the way, without disabling the entire hook all together.

Use Case

We have some old code where a hook is updating the code and is doing it with the new way instead of the old way. We can work on upgrading the code or fixing the hook. We’d prefer punting for now to get the changes out and creating a ticket in the next sprint to fix the underlying issue.

Describe Ideal Solution

- uses: cloudposse/[email protected]
  with:
    skip-pr-label: 'skip-precommit' # Hypothetically this is the default value

Alternatives Considered

One alternative is to bake an if condition before the action is called

- uses: cloudposse/[email protected]
  if: contains(github.event.pull_request.labels.*.name, 'skip-precommit')

Additional Context

N/A

RB avatar

cc: @Igor Rodionov

#28 Ability to skip pre-commit on specific commits or PRs

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

Slack Community

Describe the Feature

It would be nice to skip the pre-commit for a PR, perhaps using a PR label
It would be nice to skip the pre-commit for a commit message, perhaps using skip ci or similar

There is no way to use a native way in pre-commit to skip hooks on a specific commit message such as using skip ci. See pre-commit/pre-commit#2806.

Expected Behavior

An easy way to skip pre-commit per commit or per PR.

Usually this comes up if there is a special edge case where you need something done without one of pre-commit’s hooks getting in the way, without disabling the entire hook all together.

Use Case

We have some old code where a hook is updating the code and is doing it with the new way instead of the old way. We can work on upgrading the code or fixing the hook. We’d prefer punting for now to get the changes out and creating a ticket in the next sprint to fix the underlying issue.

Describe Ideal Solution

- uses: cloudposse/[email protected]
  with:
    skip-pr-label: 'skip-precommit' # Hypothetically this is the default value

Alternatives Considered

One alternative is to bake an if condition before the action is called

- uses: cloudposse/[email protected]
  if: contains(github.event.pull_request.labels.*.name, 'skip-precommit')

Additional Context

N/A

1
Gabriela Campana (Cloud Posse) avatar
Gabriela Campana (Cloud Posse)

@Igor Rodionov bumping this up

2024-10-08

2024-10-14

RB avatar

Noticed error This environment is externally managed recently in setup-python, had to downgrade from ubuntu-latest to ubuntu-22.04 to fix pre-commit and other common github actions that rely on python dependencies

https://github.com/actions/setup-python/issues/952#issuecomment-2410802848

Gabriela Campana (Cloud Posse) avatar
Gabriela Campana (Cloud Posse)

@Jeremy White (Cloud Posse) is this related to the issue you faced with a customer recently?

Gabriela Campana (Cloud Posse) avatar
Gabriela Campana (Cloud Posse)

anyway @Igor Rodionov

2024-10-16

johncblandii avatar
johncblandii
#70 feat: add support for build-contexts

what

• Adds support for the build-contexts arg

why

• This is needed in particular circumstances; see https://docs.docker.com/reference/cli/docker/buildx/build/#build-context

references

Confirmed on a private project:

Screenshot 2024-09-26 at 12 49 11

cool-doge1
Gabriela Campana (Cloud Posse) avatar
Gabriela Campana (Cloud Posse)

@Igor Rodionov @Yonatan Koren

#70 feat: add support for build-contexts

what

• Adds support for the build-contexts arg

why

• This is needed in particular circumstances; see https://docs.docker.com/reference/cli/docker/buildx/build/#build-context

references

Confirmed on a private project:

Screenshot 2024-09-26 at 12 49 11

johncblandii avatar
johncblandii

Can we get reviews on this?

Gabriela Campana (Cloud Posse) avatar
Gabriela Campana (Cloud Posse)

@Ben Smith (Cloud Posse) @Igor Rodionov

2024-10-17

parth bansal avatar
parth bansal

hi, I am facing issue in setting up the github action pipeline for the ios(fastlane). I have fastfile.swift file in which I have defined the Lanes. now when i am running fastlane command locally command running fine but when i am running this command through the github action pipeline I am getting error : "could not find the lane". I am running my pipeline on selfhosted runner(my personal mac). Can anyone please help me in this, I tried google search, stackoverflow, chatgpt etc but i didn't got the solution for this.

actions - GitHub Changelog avatar
actions - GitHub Changelog
04:25:37 PM
Homeattachment image

Updates, ideas, and inspiration from GitHub to help developers build and design software.

Alex Kwan avatar
Alex Kwan

i have a private repo and i want to mirror it to a public repo. I want the public repo to be devoid of the commit history. Yet I also want the public repo to be set up in a manner that allows folks outside my org to make pull requests. I know I can do something like what is found here https://github.com/pixta-dev/repository-mirroring-action/blob/main/mirror.sh but I need some help modifying it.

#!/usr/bin/env sh
set -eu

/setup-ssh.sh

export GIT_SSH_COMMAND="ssh -v -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no -l $INPUT_SSH_USERNAME"
git remote add mirror "$INPUT_TARGET_REPO_URL"
git push --tags --force --prune mirror "refs/remotes/origin/*:refs/heads/*"

# NOTE: Since `post` execution is not supported for local action from './' for now, we need to
# run the command by hand.
/cleanup.sh mirror

2024-10-24

2024-10-27

Kristoffer avatar
Kristoffer

Hello there,

I want Github Actions to auto-approve “tofu plan” but require review for “tofu apply” and then auto-merge when all workflows are successful. But as it is, Github Actions wants review whenever any stupid job is run within an environment with Required Approvers, so I created a “auto-approve” action and want to authenticate with my GitHub App - but it seems the approval HAS to be a Personal Token (probably because the required approvers can only be users, not apps) https://stackoverflow.com/questions/79044626/cant-approve-deployment-via-cli-rest-api-even-when-there-are-pending-deploys

Is anybody able to work around this issue ? Maybe with this new octo-sts https://www.chainguard.dev/unchained/the-end-of-github-pats-you-cant-leak-what-you-dont-have ?

I know I could fix this by creating different environments for plan and apply, but my OCD wants to make this work without it… maybe I should see a doctor instead ?

Can't approve deployment via CLI/REST API even when there are pending deploys

I have a case in which, for a given environment, some repos can be set to auto-deploy while other repos require manual approval. I landed on a pattern of using another parallel job to auto-approve it

The end of GitHub PATs: You can’t leak what you don’t haveattachment image

Ditch GitHub PATs for better security. Learn how to replace long-lived tokens and reduce your risk of leaked credentials.

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

The new way of handling this is using repo/org rulesets

Can't approve deployment via CLI/REST API even when there are pending deploys

I have a case in which, for a given environment, some repos can be set to auto-deploy while other repos require manual approval. I landed on a pattern of using another parallel job to auto-approve it

The end of GitHub PATs: You can’t leak what you don’t haveattachment image

Ditch GitHub PATs for better security. Learn how to replace long-lived tokens and reduce your risk of leaked credentials.

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

Then configuring an app bypass

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

Using required approvers is the old way of doing this, and yes, only works with PATs (aka real github accounts)

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

The app can then be configured to bypass the ruleset.

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

We do similar things in our org.

Kristoffer avatar
Kristoffer

Aha ! I’m not sure how workflows can be protected by rulesets, but I will look into it. Thanks !

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

If I’m reading this correctly:
But as it is, Github Actions wants review whenever any stupid job is run within an environment with Required Approvers, so I created a “auto-approve” action and want to authenticate with my GitHub App
The “an environment with Required Approvers” can be bypassed with a ruleset. But you need to replace your old branch protections with new rulesets.

Kristoffer avatar
Kristoffer

Are you referring to approval of merge requests, or workflow runs ? I don’t see how rulesets can make a app bypass a workflow approval? Forgive me if I’m too slow to understand

to clarify: In environment “prod” I have a deployment protection rule, requiring 1 review to approve workflow run.

I have two workflows: plan.yaml and apply.yaml :

plan.yaml requires access to “prod” environment secrets, but should be able to run without approval, while apply.yaml should require approval.

Thanks for your help !

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

So here’s an example of how we use rulesets. First we make them small, and specialized. Rulesets are additive, so all rulesets that apply will be required.

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

Then we allow apps like mergify to bypass the rule

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

but the rules are required for all humans

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

And then we deleted all branch protections

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

Now, I see github has renamed those to “classic branch protections”

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


In environment “prod” I have a deployment protection rule, requiring 1 review to approve workflow run.

I have two workflows: plan.yaml and apply.yaml :

plan.yaml requires access to “prod” environment secrets, but should be able to run without approval, while apply.yaml should require approval.
Sorry, I was solving how to do it with Pull Requests, not environment protection rules.

Kristoffer avatar
Kristoffer

Yes, I saw that, but it seems to me that I would need a external service to interact with the hook and approve the workflow, which is a bit too much I don’t see how this usecase can work, without creating a GitHub user called “auto-approve” and create a personal access token for these approvals.

But thankyou for guidance !

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

Understood - I was under the impression it could be any GitHub action, but you are right it seems it must be a an app.

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

Out of curiosity, what is the approval logic you seek to implement?

Kristoffer avatar
Kristoffer

Simplest possible approval: (at least I thought :)

• trunk based terraform repo

• GitHub environments test/prod

• matrix workflow for multiple root modules

• Reusable workflows are triggered:

• - when test tag is added to pr, tofu plan/apply runs automatically on test env (if all jobs succeed)

• - when prod tag is added to pr, tofu plan runs, adds plan output (tfcmt) to pr, and stores plan artifact to S3 - then if all jobs is succes’s, run apply in prod but wait for human workflow approval - when approved, tofu apply runs, changelog is written to github wiki, and pr is automerged.

2024-10-28

2024-10-29

2024-10-31

actions - GitHub Changelog avatar
actions - GitHub Changelog
02:45:40 PM

Actions Performance Metrics in public preview Actions Performance Metrics in public preview The post Actions Performance Metrics in public preview appeared first on The GitHub Blog.

Actions Performance Metrics in public preview · GitHub Changelogattachment image

Actions Performance Metrics in public preview

Homeattachment image

Updates, ideas, and inspiration from GitHub to help developers build and design software.

    keyboard_arrow_up