diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 9267c72278a96bfd0752d80c77eca6cae05a90e4..3d81f5a00704e627241dcf6c05ae156ede35b4bd 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -24,7 +24,8 @@ jobs: strategy: max-parallel: 2 matrix: - ansible: ["9", "latest"] + ansible: ["9", "10"] + python: ["3.10", "3.12"] steps: - name: Check out the codebase @@ -33,7 +34,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "${{ matrix.python }}" cache: "pip" cache-dependency-path: .requirements/${{ matrix.ansible }}.txt diff --git a/.github/workflows/push-rebase.yaml b/.github/workflows/push-rebase.yaml index 4b4049ae1d4b91b01e7ece713cf834da892c503c..224d4fab8c210334a66c4935a170bfb9bf637e54 100644 --- a/.github/workflows/push-rebase.yaml +++ b/.github/workflows/push-rebase.yaml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Rebase all pull requests on push to the main branch - uses: peter-evans/rebase@v3.0.0 + uses: peter-evans/rebase@v3.1.0 with: base: main exclude-drafts: true diff --git a/.github/workflows/schedule_update-from-template.yaml b/.github/workflows/schedule_update-from-template.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e7536a4ad42df3423d562d0ed492c61549a65683 --- /dev/null +++ b/.github/workflows/schedule_update-from-template.yaml @@ -0,0 +1,29 @@ +name: Update from template +"on": + schedule: + - cron: "00 00 * * *" + workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false +jobs: + merge: + name: Update from template + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4.1.6 + with: + token: ${{ secrets.PAT }} + fetch-depth: 0 + + - name: Run update script + run: bash update.sh + + - name: Commit changes back to repository + uses: EndBug/add-and-commit@v9.1.4 + with: + commit: --signoff + default_author: github_actor + fetch: true + message: 'ci: update from template' diff --git a/.requirements/10.txt b/.requirements/10.txt new file mode 100644 index 0000000000000000000000000000000000000000..328d34adf25e0256f77bba9a3fe19d81b5b42ce0 --- /dev/null +++ b/.requirements/10.txt @@ -0,0 +1,3 @@ +# Requirements for ansible 10 +ansible >=10, <11 +ansible-lint diff --git a/.requirements/9.txt b/.requirements/9.txt index 893a015be33702f5bb8abc140d26f3c7d478b7da..d3e011dd69bb12ce6704f1339cefb6acec1a99c9 100644 --- a/.requirements/9.txt +++ b/.requirements/9.txt @@ -1,3 +1,3 @@ -# Requirements for ansible stable +# Requirements for ansible 9 ansible >=9, <10 ansible-lint diff --git a/.requirements/latest.txt b/.requirements/latest.txt deleted file mode 100644 index 9184e414ec0a01061ec0c619f8d0646570025f7d..0000000000000000000000000000000000000000 --- a/.requirements/latest.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Requirements for ansible latest -ansible -ansible-lint diff --git a/update.sh b/update.sh index 439b3744b7a6ee87c71371894dfa95877a39a7c5..686e61c605426a62b09881c1d5189185bcc15465 100755 --- a/update.sh +++ b/update.sh @@ -5,15 +5,13 @@ git \ https://github.com/dmitriysafronov/ansible_role-template.git \ .update -rsync -av \ - --include=.github/ \ - --include=.github/workflows/ \ - --include=.github/workflows/lint.yaml \ - --include=.requirements/* \ - --include=update.sh \ - --exclude=* \ - --delete-after \ - .update/ \ - ./ +if [[ -s .update/update.list ]]; then + rsync -av \ + --include-from=.update/update.list \ + --exclude=* \ + --delete-after \ + .update/ \ + ./ +fi rm -rf .update/