Debian Codegraph @

ansible_collections/community/sops/roles/install/tasks/github_latest_release.yml

raw
1 ---
2 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
3 # SPDX-License-Identifier: GPL-3.0-or-later
4 # SPDX-FileCopyrightText: 2022, Felix Fontein
5
6 - name: Fetch the latest release from GitHub
7 ansible.builtin.uri:
8 follow_redirects: "none"
9 status_code:
10 - 302
11 - 307
12 url: https://github.com/getsops/sops/releases/latest/
13 register: _community_sops_install_github_latest_release
14 delegate_to: localhost
15 run_once: true
16
17 - name: Determine the latest release
18 ansible.builtin.set_fact:
19 _community_sops_install_effective_sops_version: >-
20 {{
21 _community_sops_install_github_latest_release.location
22 | default("", true)
23 | ansible.builtin.regex_search("(?<=/releases/tag/)([0-9a-z._-]+)")
24 | default("", true)
25 | ansible.builtin.regex_replace("^v", "")
26 }}
27
28 - name: In case this failed, inform user
29 ansible.builtin.debug:
30 msg: >-
31 Could not obtain latest version from https://github.com/getsops/sops/releases/latest/.
32 Please create an issue in https://github.com/ansible-collections/community.sops/issues/
33 if there is not already one.
34 when: _community_sops_install_effective_sops_version == ''