Questions tagged [github-actions]

GitHub Actions allows you to easily automate your software workflows. Use this tag for questions regarding help on creating a workflow. If you need help on GitHub Actions in general, consider contacting GitHub by emailing their support (support.github.com/contact) or by asking in GitHub's Community Forum (github.community).

GitHub Actions extend GitHub's open source network and principles across the software development lifecycle. You can use GitHub Actions to automate your workflow, express business or organization rules, or connect all of the services your project uses, right in your project's repository.

You can write customized actions to interact with a repository in any way you'd like, including integrating with GitHub's APIs and any publicly available third-party API.

Add actions to your project by referencing them in your repository's workflow. Your workflows can reference actions located in your own repository, or in any public repository on GitHub.

Actions are defined in a Docker container. Actions run in an environment where they have access to the code in your repository, variables you define, and secrets you make available to the action.

More info:

9387 questions
331
votes
33 answers

How to get the current branch within Github Actions?

I'm building Docker images with Github Actions and want to tag images with the branch name. I found the GITHUB_REF variable, but it results in refs/heads/feature-branch-1 and I need only feature-branch-1.
aborilov
  • 7,416
  • 3
  • 21
  • 20
280
votes
2 answers

How to apt-get install in a GitHub Actions workflow?

In the new GitHub Actions, I am trying to install a package in order to use it in one of the next steps. name: CI on: [push, pull_request] jobs: translations: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 with: …
Niklas
  • 3,753
  • 4
  • 21
  • 29
270
votes
9 answers

How to run a github-actions step, even if the previous step fails, while still failing the job

I'm trying to follow an example Github has for testing my build with github actions, and then compressing the test results and uploading them as an…
Tomer Shemesh
  • 10,278
  • 4
  • 21
  • 44
270
votes
3 answers

Running actions in another directory

I've just started exploring Github actions however I've found myself placing a command in multiple places. I have a PHP project where the composer.json is not in the root, my structure looks like: my-project: readme.md app: …
MylesK
  • 3,349
  • 2
  • 9
  • 31
237
votes
9 answers

How to run GitHub Actions workflows locally?

I am planning to move our Travis CI build to GitHub Actions using Docker for our per-commit testing. Can I reproducibly run these new GitHub Actions workflows locally? Is there a generic way to run any GitHub Actions workflow locally?
William Entriken
  • 37,208
  • 23
  • 149
  • 195
234
votes
12 answers

Only run job on specific branch with GitHub Actions

I'm relatively new to GitHub Actions and I have 2 jobs–one that runs my tests, and one that deploys my project onto a server. Obviously I want the tests to run on every branch, but deploying should only happen when something gets pushed to…
weakdan
  • 2,616
  • 3
  • 12
  • 13
226
votes
3 answers

How do I set an env var with a bash expression in GitHub Actions?

In GitHub Actions, I'd like to evaluate a bash expression and then assign it to an environment variable: - name: Tag image env: GITHUB_SHA_SHORT: ${{ $(echo $GITHUB_SHA | cut -c 1-6) }} ..do other things... However, this…
evilSnobu
  • 24,582
  • 8
  • 41
  • 71
208
votes
18 answers

How to resolve "refusing to allow an OAuth App to create or update workflow" on git push

Getting refusing to allow an OAuth App to create or update workflow .github/workflows/cd.yml without workflow scope" on git push. How to grant workflow scope?
Ara Yeressian
  • 3,746
  • 3
  • 26
  • 36
188
votes
5 answers

Dependencies Between Workflows on Github Actions

I have a monorepo with two workflows: .github/workflows/test.yml name: test on: [push, pull_request] jobs: test-packages: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - name: test packages run: | …
181
votes
5 answers

Github actions share workspace/artifacts between jobs?

Trying to use Github's beta actions, I have two jobs, one that builds the code and then one that will deploy code. However, I can't seem to get the build artifact in deploy job. My latest attempt is to manually set a container image with the same…
Labithiotis
  • 3,519
  • 7
  • 27
  • 47
174
votes
7 answers

Github Action: Split Long Command into Multiple Lines

I have a Github action command that is really long: name: build on: [push] jobs: build: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v1 - name: Install Prerequisites run: | …
Bojian Zheng
  • 2,167
  • 3
  • 13
  • 17
154
votes
32 answers

Delete a workflow from GitHub Actions

I create a couple workflows in the .github/workflows folder of my repository to experiment with GitHub Actions. I have since learned quite a bit and deleted said "experimental" workflows from my repo. After deleting the "experimental" workflow yaml…
skålfyfan
  • 4,931
  • 5
  • 41
  • 59
140
votes
3 answers

Repository 'http://security.debian.org/debian-security buster/updates InRelease' changed its 'Suite' value from 'stable' to 'oldstable'

Some of my GitHub Actions workflows started recently to return this error when installing Chromedriver: Get:1 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB] Get:2 http://deb.debian.org/debian buster InRelease [122…
GuiFalourd
  • 15,523
  • 8
  • 44
  • 71
125
votes
1 answer

Set default Timeout on Github action pipeline

Normally, my pipelines take 15 minutes to execute. Recently, for some strange reasons, some pipelines take between 45 minutes and 6 hours to fail. Is it possible to set a default timeout limit on GitHub Action's pipeline (for example, auto cancel…
Kevin ABRIOUX
  • 16,507
  • 12
  • 93
  • 99
125
votes
8 answers

Get the current pushed tag in Github Actions

Is there a way to access the current tag that has been pushed in a Github Action? In CircleCI you can access this value with the $CIRCLE_TAG variable. My Workflow yaml is being triggered by a tag like so: on: push: tags: - 'v*.*.*' And…
Jon B
  • 2,444
  • 2
  • 18
  • 19
1
2 3
99 100