Files
awx/tools/ansible/release.yml
2021-08-30 15:12:15 -04:00

30 lines
777 B
YAML

---
- hosts: localhost
connection: local
vars:
payload:
body: "{{ lookup('file', changelog_path) | replace('\\n', '\n') }}"
name: "{{ version }}"
tag_name: "{{ version }}"
draft: true
tasks:
- name: Prepare Release Data
set_fact:
payload:
body: "{{ lookup('file', changelog_path) }}"
name: "{{ version }}"
tag_name: "{{ version }}"
draft: true
- name: Publish Release
uri:
url: "https://api.github.com/repos/{{ repo }}/releases"
method: "POST"
headers:
Accept: "application/vnd.github.v3+json"
Authorization: "Bearer {{ github_token }}"
body: "{{ payload | to_json }}"
status_code:
- 200
- 201