0

I had a hard time trying to find specific attributes or data that could be useful while writing some GitHub Actions so I decided to log out everything in the context object and put it all in one place. Hope this is helpful to others. For clarity, these are the outputs from inside a script using this GH Action - https://github.com/actions/github-script

Context {
  payload: {
    after: string,
    base_ref: null,
    before: string,
    commits: [ [Object] ],
    compare: string,
    created: boolean,
    deleted: boolean,
    forced: boolean,
    head_commit: {
      author: [Object],
      committer: [Object],
      distinct: boolean,
      id: string,
      message: string,
      timestamp: string,
      tree_id: string,
      url: string
    },
    organization: {
      avatar_url: string,
      description: string,
      events_url: string,
      hooks_url: string,
      id: number,
      issues_url: string,
      login: string,
      members_url: string,
      node_id: string,
      public_members_url: string,
      repos_url: string,
      url: string
    },
    pusher: { email: string, name: string },
    ref: string,
    repository: {
      allow_forking: boolean,
      archive_url: string,
      archived: boolean,
      assignees_url: string,
      blobs_url: string,
      branches_url: string,
      clone_url: string,
      collaborators_url: string,
      comments_url: string,
      commits_url: string,
      compare_url: string,
      contents_url: string,
      contributors_url: string,
      created_at: number | Date,
      default_branch: string,
      deployments_url: string,
      description: string,
      disabled: boolean,
      downloads_url: string,
      events_url: string,
      fork: boolean,
      forks: number,
      forks_count: number,
      forks_url: string,
      full_name: string,
      git_commits_url: string,
      git_refs_url: string,
      git_tags_url: string,
      git_url: string,
      has_discussions: boolean,
      has_downloads: boolean,
      has_issues: boolean,
      has_pages: boolean,
      has_projects: boolean,
      has_wiki: boolean,
      homepage: string,
      hooks_url: string,
      html_url: string,
      id: number,
      is_template: boolean,
      issue_comment_url: string,
      issue_events_url: string,
      issues_url: string,
      keys_url: string,
      labels_url: string,
      language: string,
      languages_url: string,
      license: null,
      master_branch: string,
      merges_url: string,
      milestones_url: string,
      mirror_url: null,
      name: string,
      node_id: string,
      notifications_url: string,
      open_issues: number,
      open_issues_count: number,
      organization: string,
      owner: [Object],
      private: boolean,
      pulls_url: string,
      pushed_at: number | Date,
      releases_url: string,
      size: number,
      ssh_url: string,
      stargazers: string,
      stargazers_count: string,
      stargazers_url: string,
      statuses_url: string,
      subscribers_url: string,
      subscription_url: string,
      svn_url: string,
      tags_url: string,
      teams_url: string,
      topics: [],
      trees_url: string,
      updated_at: string,
      url: string,
      visibility: 'private' | 'public' | string,
      watchers: number,
      watchers_count: number,
      web_commit_signoff_required: boolean
    },
    sender: {
      avatar_url: string,
      events_url: string,
      followers_url: string,
      following_url: string,
      gists_url: string,
      gravatar_id: string,
      html_url: string,
      id: number,
      login: string,
      node_id: string,
      organizations_url: string,
      received_events_url: string,
      repos_url: string,
      site_admin: boolean,
      starred_url: string,
      subscriptions_url: string,
      type: 'User',
      url: string
    }
  },
  eventName: 'push',
  sha: string,
  ref: string,
  workflow: string,
  action: string,
  actor: string,
  job: string,
  runNumber: number,
  runId: number,
  apiUrl: string,
  serverUrl: string,
  graphqlUrl: string
}
CeCe
  • 19
  • 1
  • 2
    You should phrase this as a self-answered question, and even those aren't always well-received – as is, this isn't really a question and not a good fit for the Q&A format of Stack Overflow. – Benjamin W. Jun 10 '23 at 18:26

0 Answers0