{"id":15479864,"url":"https://github.com/gr2m/watch-single-file-action-example","last_synced_at":"2025-08-02T10:32:54.154Z","repository":{"id":39947269,"uuid":"243819335","full_name":"gr2m/watch-single-file-action-example","owner":"gr2m","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-12T04:34:06.000Z","size":49,"stargazers_count":3,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-07T19:52:49.118Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gr2m.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-02-28T17:34:21.000Z","updated_at":"2024-03-21T18:26:04.000Z","dependencies_parsed_at":"2023-01-17T18:45:33.559Z","dependency_job_id":null,"html_url":"https://github.com/gr2m/watch-single-file-action-example","commit_stats":{"total_commits":21,"total_committers":3,"mean_commits":7.0,"dds":"0.38095238095238093","last_synced_commit":"ad0913f85276ca1789b2e905e681078d096feba2"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gr2m/watch-single-file-action-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Fwatch-single-file-action-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Fwatch-single-file-action-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Fwatch-single-file-action-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Fwatch-single-file-action-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gr2m","download_url":"https://codeload.github.com/gr2m/watch-single-file-action-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Fwatch-single-file-action-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265527453,"owners_count":23782480,"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":[],"created_at":"2024-10-02T04:28:26.510Z","updated_at":"2025-08-02T10:32:54.099Z","avatar_url":"https://github.com/gr2m.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# watch-single-file-action-example\n\n\u003e Example for a GitHub Action that acts on changes to a single file\n\n## How it works\n\nThe workflow is defined in [`.github/workflows/watch-file.yaml`](.github/workflows/watch-file.yaml).\n\nOn every push event, [`index.js`](index.js) is run. The file that is being watched is passed as `FILE_PATH_TO_WATCH` environment variable. The [payload from the push event](https://developer.github.com/v3/activity/events/types/#pushevent) includes two properties: `\"before\"` and `\"after\"`, which ared use to find out which files have been changed using the [Compare two commits](https://developer.github.com/v3/repos/commits/#compare-two-commits) endpoint. If the changed files include the file that is being watched, the `\"changed\"` output for the step is set to `\"true\"`.\n\nThe next step can check for this output in order to act on the file change.\n\n## LICENSE\n\n[ISC](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgr2m%2Fwatch-single-file-action-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgr2m%2Fwatch-single-file-action-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgr2m%2Fwatch-single-file-action-example/lists"}