'I'm trying to get list of all updated files on pull request using github actions inside github-action variable
I actually wants to get all file names which are updated while pull request. I'm using github action, so I want all updated file names should come in one variable. If anyone can help me on getting all updated file names in one variable in github actions will be great.
I tried doing:
# Make sure we have some code to diff.
- name: Checkout repository
uses: actions/checkout@v2
- name: Get changed files
id: changes
# Set outputs using the command.
run: |
echo "::set-output name=all::$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | xargs)"
echo "::set-output name=ts::$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep .ts$ | xargs)"
lint: runs-on: ubuntu-latest # require the first job to have ran needs: changedfiles # only run there are changed files if: ${{needs.changedfiles.outputs.ts}} steps: - name: echo changed files run: echo ${{needs.changedfiles.outputs.ts}}
got error saying:
error: Could not access 'f57a9fe09ef4538dcae55e7a5d5b2761d562760f' /home/aakha2/actions-runner/_work/_temp/03d4c98c-6167-4e4f-ad93-0af8b01c3213.sh: line 3: run:: command not found error: Could not access 'f57a9fe09ef4538dcae55e7a5d5b2761d562760f'
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
