Giter Club home page Giter Club logo

Comments (1)

corym-vermeer avatar corym-vermeer commented on July 1, 2024

Here is my current working solution. I'm sure there are better ways to do this though I'm not finding much for published examples.

GitHub Action Step

    - name: Run Playbook
      uses: 'dawidd6/action-ansible-playbook@v2'
      env:
        ANSIBLE_STDOUT_CALLBACK: debug
        ANSIBLE_DISPLAY_FAILED_STDERR: yes
        ANSIBLE_SHOW_TASK_PATH_ON_FAILURE: yes
      with:
        playbook: 'playbook.yml'
        directory: ./
        requirements: requirements.yml
        options: |
          --inventory hosts.yml
          --extra-vars github_summary_file=${{ inputs.github_summary_file }}
          --check
    - name: Create Github Step Summary
      if: always()
      shell: bash
      run: |
        if [[ -r "${{ inputs.github_summary_file }}" ]]; then
          cat ${{ inputs.github_summary_file }} >> $GITHUB_STEP_SUMMARY
        else 
          echo "Missing Step Summary File (${{ inputs.github_summary_file }} )"
        fi

Ansible Playbook snippet to create the summary file using a template

- name: "Create gitHub summary {{ github_summary_file }}"
  ansible.builtin.template:
    src: github_summary.md.j2
    dest: "{{ github_summary_file }}"
  with_items:
    - "{{ output }}"
  delegate_to: localhost
  become: false
  when:
    github_summary_file is defined

from action-ansible-playbook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.