#github-actions - February 2024

5 messages

Discussions related to GitHub Actions

February 2024
wbrown43
wbrown43over 2 years ago
We are encountering an issue where pre-commit https://github.com/cloudposse/github-action-pre-commit is failing ERROR: terraform-docs is required by terraform_docs pre-commit hook but is not installed or in the system's PATH. There is a terraform install step that completes prior to the pre-commit step. Here is a screen shot of the run:
wbrown43
wbrown43over 2 years ago
@johncblandii
rss
rssover 2 years ago(edited)
Deprecation notice: v1 and v2 of the artifact actions
Deprecation notice: v1 and v2 of the artifact actions
The post Deprecation notice: v1 and v2 of the artifact actions appeared first on The GitHub Blog.
Saichovsky
Saichovskyover 2 years ago
Hello,

I have a job that looks something like this:

jobs:
  pop-values-from-list:
    runs-on: my-runner
    env:
      MY_LIST: '[1,2,3,4,5,6,7,8,9,0]' # list has 10 items
    steps:
      - name: Pop 10% of list
        run: |
          pop_my_list() {
            percentage=$1
            list=$2
            MY_LIST=$(process_and_pop $percentage $list) >>"$GITHUB_OUTPUT"
          }
          pop_my_list 10% $MY_LIST # MY_LIST now has 9 items
      - run: WaitForAsyncProcess
      - name: Pop 20% of list
        run: |
          pop_my_list() {
            percentage=$1
            list=$2
            MY_LIST=$(process_and_pop $percentage $list) >>"$GITHUB_OUTPUT"
          }
          pop_my_list 20% $MY_LIST # let's assume that MY_LIST now has 7 items
      - run: WaitForAsyncProcess
...
      - name: Pop everything that remains in list
        ...

This is of course a simplified version of what I am trying to achieve. The problem here is that I have to keep repeating the function definition for pop_my_list()

Is there a way I can have the function defined once and invoke it across steps without repetition?
Tony
Tonyover 2 years ago
Hello all - we are trying to update our workflows and actions to node20 and are using your excellent github-action-matrix-outputs-write and github-action-matrix-outputs-read actions.
github-action-matrix-outputs-read unfortunately is still using an older version of actions/download-artifact which uses node16 and I see an automatic PR in your repo to update it is failing :(
Are there any plans to update this to use v4 of actions/download to address this?
The v4 actions have breaking changes and now uploaded artifacts are immutable so it may be that github-action-matrix-outputs-write needs some changes at the same time so that they continue to work as expected?