githubtraining / using-github-actions-for-ci

Course repository for "GitHub Actions: Continuous Integration"
https://lab.github.com/githubtraining/github-actions:-continuous-integration
Creative Commons Attribution 4.0 International
3 stars 16 forks source link

undocumented payload keys in use #26

Closed mattdavis0351 closed 4 years ago

mattdavis0351 commented 4 years ago

Bug Report

Current behavior There are steps in the config.yml that reference payload keys which aren't documented in the GitHub Event Types & Payloads documentation.

Reproduction

GitHub API docs:

 "app": {
      "id": 29310,
      "node_id": "MDM6QXBwMjkzMTA=",
      "owner": {
        "login": "Octocoders",
        "id": 38302899,
        "node_id": "MDEyOk9yZ2FuaXphdGlvbjM4MzAyODk5",
        "avatar_url": "https://avatars1.githubusercontent.com/u/38302899?v=4",
        "gravatar_id": "",
        "url": "https://api.github.com/users/Octocoders",
        "html_url": "https://github.com/Octocoders",
        "followers_url": "https://api.github.com/users/Octocoders/followers",
        "following_url": "https://api.github.com/users/Octocoders/following{/other_user}",
        "gists_url": "https://api.github.com/users/Octocoders/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/Octocoders/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/Octocoders/subscriptions",
        "organizations_url": "https://api.github.com/users/Octocoders/orgs",
        "repos_url": "https://api.github.com/users/Octocoders/repos",
        "events_url": "https://api.github.com/users/Octocoders/events{/privacy}",
        "received_events_url": "https://api.github.com/users/Octocoders/received_events",
        "type": "Organization",
        "site_admin": false
      },

Smee Payload:

"app":{
"id":15368
"slug":"github-actions"
"node_id":"MDM6QXBwMTUzNjg="
"owner":{...}
"name":"GitHub Actions"
"description":"Powers your `.github/main.workflow`."
"external_url":"https://developer.github.com/actions/"
"html_url":"https://github.com/apps/github-actions"
"created_at":"2018-07-30T09:30:17Z"
"updated_at":"2019-01-25T22:34:06Z"
"permissions":{...}
"events":[...]
}

**Config.yml:***

  - title: Run a templated workflow
    description: Wait for GitHub to run the templated workflow and report back the results
    event: check_suite.completed
    link: '{{ repoUrl }}/pull/2'
    actions:
      - type: gate
        left: '%payload.check_suite.app.slug%'
        operator: ===
        right: github-actions
      - type: respond
        with: 0X_merge.md
        issue: Add jest tests
        action_id: jestPr
      - type: respond
        issue: CI for Node
        with: 02_template-workflow-ran.md
        data:
          url: '%actions.jestPr.data.html_url%'
          actionsUrl: '%payload.repository.html_url%/actions'

Possible solution We should probably stick to whats accessible in the docs to avoid confusing anyone who looks at this code.

mattdavis0351 commented 4 years ago

This is outdated significantly. Will reopen if we need to, but closing for now