Hide the ugly parts in a custom action

This commit is contained in:
Shane McDonald
2021-08-29 17:43:39 -04:00
parent 1c65fbaae3
commit 9c3e78443b
4 changed files with 42 additions and 89 deletions

View File

@@ -1,5 +1,29 @@
---
- hosts: localhost
connection: local
roles:
- release
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