Skip to content

Add missing pull-requests permission for workflow #53

Add missing pull-requests permission for workflow

Add missing pull-requests permission for workflow #53

Workflow file for this run

---
name: Yaml and Ansible Lint
on: [push, pull_request, workflow_call] # yamllint disable-line rule:truthy
jobs:
ansible-lint:
runs-on: ubuntu-latest
if: always() && github.repository == 'redhat-cop/infra.convert2rhel'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Ansible
run: pip install --upgrade ansible-core
- name: Build collection
run: ansible-galaxy collection build -vvv
shell: bash
working-directory: ${{ vars.GITHUB_PATH }}
- name: Get version
run: echo "NUM=$(cat galaxy.yml | grep 'version:' | cut -d ':' -f 2 | awk '{print $1}')" >> $GITHUB_OUTPUT
id: vers
- name: Install collection
run: ansible-galaxy collection install ./infra-convert2rhel-${{ steps.vers.outputs.NUM }}.tar.gz
shell: bash
working-directory: ${{ vars.GITHUB_PATH }}
- name: Get dependencies # This sucks lol
run: echo "---" >> ${{ github.run_id }}.yml; echo "collections:" >> ${{ github.run_id }}.yml; cat galaxy.yml | grep -A100 'dependencies:' | cut -d ':' -f 1 | cut -d '"' -f 2 | sed 's/dependencies//' | sed 's/\.\.\.//' | awk NF | sed 's/^/ - name:{{:dumb_space_issue:}}/' >> ${{ github.run_id }}.yml; sed -i 's/{{:dumb_space_issue:}}/ /g' ${{ github.run_id }}.yml; echo "..." >> ${{ github.run_id }}.yml
id: deps
- name: Install collection dependencies
run: ansible-galaxy collection install -r ${{ github.run_id }}.yml
- uses: ansible/ansible-lint@v24
with:
working_directory: .
args: --config=.ansible-lint.yml
...