{"id":20236055,"url":"https://github.com/chingc/demo-github-actions","last_synced_at":"2025-03-03T14:24:04.383Z","repository":{"id":251673175,"uuid":"838086226","full_name":"chingc/demo-github-actions","owner":"chingc","description":"GitHub Actions quickstart and reference for my future self.","archived":false,"fork":false,"pushed_at":"2025-01-08T01:09:38.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-08T02:20:06.940Z","etag":null,"topics":["demo","github-actions","quickstart","reference","tutorial"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chingc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-04T22:32:28.000Z","updated_at":"2025-01-08T01:09:40.000Z","dependencies_parsed_at":"2025-01-08T02:20:11.176Z","dependency_job_id":"cc0a3a24-7611-489e-ad12-8d3acaf62240","html_url":"https://github.com/chingc/demo-github-actions","commit_stats":null,"previous_names":["chingc/demo-github-actions"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chingc%2Fdemo-github-actions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chingc%2Fdemo-github-actions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chingc%2Fdemo-github-actions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chingc%2Fdemo-github-actions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chingc","download_url":"https://codeload.github.com/chingc/demo-github-actions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241679323,"owners_count":20001934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["demo","github-actions","quickstart","reference","tutorial"],"created_at":"2024-11-14T08:18:55.947Z","updated_at":"2025-03-03T14:24:04.361Z","avatar_url":"https://github.com/chingc.png","language":"Python","readme":"# Demo: GitHub Actions\n\nA collection of GitHub Actions workflows where I demonstrate various capabilities and features.\n\nThey serve as a quickstart and reference for my future self. Each are described below.\n\n## basic.yml\n\nA basic workflow to do all the essentials.\n\n- Runs when changes are pushed\n- Runs on a schedule\n- Can be run manually from the GitHub UI\n- Uses [actions/checkout](https://github.com/actions/checkout)\n- Uses [actions/setup-python](https://github.com/actions/setup-python) with pip cache\n- Installs `requirements.txt` and runs a simple test\n- Includes `dependabot.yml` to automatically check for package updates\n\n## branch_name.yml\n\nGetting the branch name is a common CI operation. Surprisingly, there's no pre-defined way to get it in GitHub Actions.\n\nThis demo shows the simplest way without using 3rd party actions or invoking various tools.\n\nIt works in most cases, but there are some quirks.\n\nFor example, if your commit is tagged this method will return the tag instead of the branch name. See SO link in the references for details.\n\nYou may also get an unexpected result depending on the event that triggered the workflow. This demo is set to trigger on `pull_request` and on `push` to illustrate this behavior.\n\n- Shows various `github` context properties that may or may not contain the branch name\n- Sets branch name to the top level `env` so it can be accessed by the entire workflow\n\n## context.yml\n\nContexts are a way to access information about workflow runs, variables, runner environments, jobs, and steps.\n\nThis can be helpful for debugging workflow errors or bugs.\n\n\u003e Warning: Be careful when printing the entire context as it may contain sensitive information.\n\n- Shows various contexts\n\n## env_var.yml\n\nEnvironment variables and their scopes work as you'd expect in GitHub Actions.\n\nThey're also fairly self-contained, so any changes you make are isolated to the job you're in.\n\nOne quirk that can cause confusion is the fact that environment variables defined within a step aren't accessible until the next step.\n\n- Read env vars\n- Write env vars\n- Pass env vars\n\n## env_var_path.yml\n\nRead, write, and modify PATH like any other environment variable. It has the same quirks.\n\n- Modify PATH env var\n\n## github_script.yml\n\nGitHub provides an action that lets you easily write javascript directly in your workflow.\n\nThe action includes an object with the current workflow context and references to several other useful packages. It's also a pre-authenticated octokit/rest.js client.\n\n- Uses [actions/github-script](https://github.com/actions/github-script)\n\n## homebrew.yml\n\nIf you develop on macOS you're probably familiar with [homebrew](https://brew.sh).\n\nDid you know it's also available on Linux?\n\nThis demo shows how you can leverage its power and convenience to install applications on GitHub Actions runners.\n\n- Uses [Homebrew/actions/setup-homebrew](https://github.com/Homebrew/actions/tree/master/setup-homebrew)\n\n## References\n\n- [GitHub Docs: GitHub Actions](https://docs.github.com/en/actions)\n\u003cbr/\u003e\u003cbr/\u003e\n- [GitHub Docs: Accessing contextual information about workflow runs](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/contexts)\n- [GitHub Docs: Adding a system path](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#adding-a-system-path)\n- [GitHub Docs: Configuration options for the dependabot.yml file](https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file)\n- [GitHub Docs: Events that trigger workflows](https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows)\n- [GitHub Docs: jobs.\u003cjob_id\u003e.outputs](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idoutputs)\n- [GitHub Docs: Setting an environment variable](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-an-environment-variable)\n- [GitHub Docs: Workflow syntax for GitHub Actions](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions)\n\u003cbr/\u003e\u003cbr/\u003e\n- [octokit/rest.js API documentation](https://octokit.github.io/rest.js)\n\u003cbr/\u003e\u003cbr/\u003e\n- [Stack Overflow: How to get a branch name on GitHub action when push on a tag?](https://stackoverflow.com/q/63745613)\n- [Stack Overflow: How to get the current branch within Github Actions?](https://stackoverflow.com/q/58033366/808678)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchingc%2Fdemo-github-actions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchingc%2Fdemo-github-actions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchingc%2Fdemo-github-actions/lists"}