summaryrefslogtreecommitdiffstats
path: root/.github/workflows/dab-release.yml
blob: cc1916817f5598e65feafdd53cbe94899ad17b4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
name: django-ansible-base requirements update
on:
  workflow_dispatch:
  schedule:
    - cron: '0 * * * *' # once an hour
permissions:
  pull-requests: write
  contents: write
jobs:
  dab-pin-newest:
    runs-on: ubuntu-latest
    steps:
      - id: dab-release
        name: Get current django-ansible-base release version
        uses: pozetroninc/github-action-get-latest-release@master
        with:
          owner: ansible
          repo: django-ansible-base
          excludes: prerelease, draft

      - name: Check out respository code
        uses: actions/checkout@v4

      - id: dab-pinned
        name: Get current django-ansible-base pinned version
        run:
          echo "version=$(requirements/django-ansible-base-pinned-version.sh)" >> "$GITHUB_OUTPUT"

      - name: Update django-ansible-base pinned version to upstream release
        run:
          requirements/django-ansible-base-pinned-version.sh -s ${{ steps.dab-release.outputs.release }}

      - name: Create Pull Request
        uses: peter-evans/create-pull-request@v6
        with:
          base: devel
          branch: bump-django-ansible-base
          title: Bump django-ansible-base
          body: |
            Automated .github/workflows/dab-release.yml

            django-ansible-base upstream released version == ${{ steps.dab-release.outputs.release }}
            requirements_git.txt django-ansible-base pinned version ==  ${{ steps.dab-pinned.outputs.version }}
          commit-message: |
            Update django-ansible-base version to ${{ steps.dab-pinned.outputs.version }}
          add-paths:
            requirements/requirements_git.txt