Running actions in another directory

Update: It’s now possible to set a working-directory default for a job. See this answer. There is an option to set a working-directory on a step, but not for multiple steps or a whole job. I’m fairly sure this option only works for script steps, not action steps with uses. https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsrun Using working-directory, your workflow … Read more

Only run job on specific branch with GitHub Actions

In a recent update you can now put if conditionals at job level. See the documentation here. https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idif I tested this workflow which runs the job test on every push, but only runs deploy on the master branch. name: my workflow on: push jobs: test: runs-on: ubuntu-latest steps: – name: Execute tests run: exit 0 … Read more

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

The docs say: The Linux and macOS virtual machines both run using passwordless sudo. When you need to execute commands or install tools that require more privileges than the current user, you can use sudo without needing to provide a password. So simply doing the following should work: – name: Install xmllint run: sudo apt-get … Read more

How to get the current branch within Github Actions?

I added a separate step for extracting branch name from $GITHUB_REF and set it to the step output – name: Extract branch name shell: bash run: echo “##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})” id: extract_branch after that, I can use it in the next steps with – name: Push to ECR id: ecr uses: jwalton/gh-ecr-push@master with: access-key-id: ${{ … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)