--- - hosts: localhost connection: local vars: changelog_path: '' payload: body: "{{ (lookup('file', changelog_path) | replace('\\n', '\n')) if changelog_path else '' }}" name: "{{ version }}" tag_name: "{{ version }}" draft: true tasks: - name: Publish draft 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