Develop-bot #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Doc-Pilot | |
on: [push, pull_request, workflow_dispatch, workflow_call] | |
permissions: | |
contents: write | |
jobs: | |
add-docstring: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: | | |
sudo apt-get install -y git diffutils | |
- name: Get changed files | |
id: changed-files | |
run: | | |
if ${{ github.event_name == 'pull_request' }}; then | |
echo "changed_files=$(git diff --name-only -r HEAD^1 HEAD | xargs)" >> $GITHUB_OUTPUT | |
else | |
echo "changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | xargs)" >> $GITHUB_OUTPUT | |
fi | |
- name: List changed files | |
run: | | |
for file in ${{ steps.changed-files.outputs.changed_files }}; do | |
echo "$file was changed" | |
done | |