{"id":18600764,"url":"https://github.com/MeltwaterArchive/drone-convert-pathschanged","last_synced_at":"2025-08-19T22:32:05.651Z","repository":{"id":40455809,"uuid":"218138392","full_name":"meltwater/drone-convert-pathschanged","owner":"meltwater","description":"Drone conversion extension to include/exclude pipelines and pipeline steps based on paths changed","archived":false,"fork":false,"pushed_at":"2024-04-17T04:57:26.000Z","size":151,"stargazers_count":135,"open_issues_count":16,"forks_count":40,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-12-08T14:03:55.235Z","etag":null,"topics":["automation-drone","clientdata-no","coe-universal-solutions","conversion-extension","department-130","department-460","drone","drone-plugin","golang","lifecycle-maintenance","purpose-library","team-a-team","team-foundation","usage-public"],"latest_commit_sha":null,"homepage":"https://docs.drone.io/extensions/conversion/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meltwater.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-28T20:24:03.000Z","updated_at":"2024-10-25T18:23:37.000Z","dependencies_parsed_at":"2023-01-21T04:43:28.486Z","dependency_job_id":"66456a57-f3f2-4a7f-a750-7b58882d8e06","html_url":"https://github.com/meltwater/drone-convert-pathschanged","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meltwater%2Fdrone-convert-pathschanged","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meltwater%2Fdrone-convert-pathschanged/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meltwater%2Fdrone-convert-pathschanged/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meltwater%2Fdrone-convert-pathschanged/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meltwater","download_url":"https://codeload.github.com/meltwater/drone-convert-pathschanged/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230374118,"owners_count":18216041,"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":["automation-drone","clientdata-no","coe-universal-solutions","conversion-extension","department-130","department-460","drone","drone-plugin","golang","lifecycle-maintenance","purpose-library","team-a-team","team-foundation","usage-public"],"created_at":"2024-11-07T02:05:17.646Z","updated_at":"2025-08-19T22:32:05.645Z","avatar_url":"https://github.com/meltwater.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚠️ Deprecation Warning ⚠️\nThis repository has been deprecated and will no longer be maintained.\n\n# Drone Conversion Extension: Paths Changed | [![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)\n\nA [Drone](https://drone.io/) [conversion extension](https://docs.drone.io/extensions/conversion/) to include/exclude pipelines and steps based on paths changed.\n\n_Please note this project requires Drone server version 1.4 or higher._\n\n## Installation\n\n## Github Cloud\n\n1. Create a github token via https://github.com/settings/tokens with the scope of`repo` (see [issue 13](https://github.com/meltwater/drone-convert-pathschanged/issues/13) for background).\n\n2. Create a shared secret:\n\n```console\n$ openssl rand -hex 16\nbea26a2221fd8090ea38720fc445eca6\n```\n\n3. Download and run the plugin:\n\n```console\n$ docker run -d \\\n  --publish=3000:3000 \\\n  --env=DRONE_DEBUG=true \\\n  --env=DRONE_SECRET=bea26a2221fd8090ea38720fc445eca6 \\\n  --env=TOKEN=9e6eij3ckzvpe9mrhnqcis6zf8dhopmm46e3pi96 \\\n  --env=PROVIDER=github \\\n  --restart=always \\\n  --name=converter meltwater/drone-convert-pathschanged\n```\nIf you wish to use an enviroment file you can pass it when starting the container :\n```console\n$ docker run -d \\\n...\n  --name=converter meltwater/drone-convert-pathschanged --envfile drone.env\n```\n\n4. Update your Drone server configuration to include the plugin address and the shared secret.\n\n```text\nDRONE_CONVERT_PLUGIN_ENDPOINT=http://1.2.3.4:3000\nDRONE_CONVERT_PLUGIN_SECRET=bea26a2221fd8090ea38720fc445eca6\n```\n\n## Github Server\n\n1. Create a github token via https://your-github-server-address/settings/token with the scope of `repo`\n\n2. Create a shares secret:\n\n```console\n$ openssl rand -hex 16\nbea26a2221fd8090ea38720fc445eca6\n```\n\n3. Download ran run the plugin:\n\n```console\n$ docker run -d \\\n  --publish=3000:3000 \\\n  --env=DRONE_DEBUG=true \\\n  --env=DRONE_SECRET=bea26a2221fd8090ea38720fc445eca6 \\\n  --env=TOKEN=9e6eij3ckzvpe9mrhnqcis6zf8dhopmm46e3pi96 \\\n  --env=PROVIDER=github \\\n  --env=GITHUB_SERVER=https://your-github-server-address\n  --restart=always \\\n  --name=converter meltwater/drone-convert-pathschanged\n```\n\n4. Update your Drone server configuration to include the plugin address and the shared secret.\n\n```text\nDRONE_CONVERT_PLUGIN_ENDPOINT=http://1.2.3.4:3000\nDRONE_CONVERT_PLUGIN_SECRET=bea26a2221fd8090ea38720fc445eca6\n```\n\n## Bitbucket Cloud\n\n1.  Create an \"App password\" via https://bitbucket.org/account/settings/app-passwords and select only \"Read\" under \"Repositories\"\n\n2. Create a shared secret:\n\n```console\n$ openssl rand -hex 16\nbea26a2221fd8090ea38720fc445eca6\n```\n\n3. Download and run the plugin:\n\n```console\n$ docker run -d \\\n  --publish=3000:3000 \\\n  --env=DRONE_DEBUG=true \\\n  --env=DRONE_SECRET=bea26a2221fd8090ea38720fc445eca6 \\\n  --env=BITBUCKET_USER=youruser \\\n  --env=BITBUCKET_PASSWORD='yourpassword' \\\n  --env=PROVIDER=bitbucket \\\n  --restart=always \\\n  --name=converter meltwater/drone-convert-pathschanged\n```\n\n4. Update your Drone server configuration to include the plugin address and the shared secret.\n\n```text\nDRONE_CONVERT_PLUGIN_ENDPOINT=http://1.2.3.4:3000\nDRONE_CONVERT_PLUGIN_SECRET=bea26a2221fd8090ea38720fc445eca6\n```\n\n## Stash (Bitbucket Server)\n\n1. Create a Stash access token via https://your-bitbucket-address/plugins/servlet/access-tokens/manage with read-only rights\n\n2. Create a shared secret:\n\n```console\n$ openssl rand -hex 16\nbea26a2221fd8090ea38720fc445eca6\n```\n\n3. Download and run the plugin:\n\n```console\n$ docker run -d \\\n  --publish=3000:3000 \\\n  --env=DRONE_DEBUG=true \\\n  --env=DRONE_SECRET=bea26a2221fd8090ea38720fc445eca6 \\\n  --env=TOKEN=9e6eij3ckzvpe9mrhnqcis6zf8dhopmm46e3pi96 \\\n  --env=PROVIDER=bitbucket-server \\\n  --env=STASH_SERVER=https://your-bitbucket-server-address\n  --restart=always \\\n  --name=converter meltwater/drone-convert-pathschanged\n```\n\n4. Update your Drone server configuration to include the plugin address and the shared secret.\n\n```text\nDRONE_CONVERT_PLUGIN_ENDPOINT=http://1.2.3.4:3000\nDRONE_CONVERT_PLUGIN_SECRET=bea26a2221fd8090ea38720fc445eca6\n```\n\n## Gitee Cloud\n\n1. Create a gitee token via https://gitee.com/personal_access_tokens with the scope of`repo` (see [issue 13](https://github.com/meltwater/drone-convert-pathschanged/issues/13) for background).\n\n2. Create a shared secret:\n\n```console\n$ openssl rand -hex 16\nbea26a2221fd8090ea38720fc445eca6\n```\n\n3. Download and run the plugin:\n\n```console\n$   docker run -d \\\n  --publish=3000:3000 \\\n  --env=DRONE_DEBUG=true \\\n  --env=DRONE_SECRET=bea26a2221fd8090ea38720fc445eca6 \\\n  --env=TOKEN=b4af6fc778a7aba5f2a133d155f5b4a9cbe7becb255557e67597a4967eb50a88 \\\n  --env=PROVIDER=gitee \\\n  --restart=always \\\n  --name=converter meltwater/drone-convert-pathschanged\n```\n\n4. Update your Drone server configuration to include the plugin address and the shared secret.\n\n```text\nDRONE_CONVERT_PLUGIN_ENDPOINT=http://1.2.3.4:3000\nDRONE_CONVERT_PLUGIN_SECRET=bea26a2221fd8090ea38720fc445eca6\n```\n\n## Examples\n\nThis extension uses [doublestar](https://github.com/bmatcuk/doublestar) for matching paths changed in your commit range, refer to their documentation for all supported patterns.\n\n### `include`\n\nOnly run a pipeline when `README.md` is changed:\n```yaml\n---\nkind: pipeline\nname: readme\n\ntrigger:\n  paths:\n    include:\n    - README.md\n\nsteps:\n- name: message\n  image: busybox\n  commands:\n  - echo \"README.md was changed”\n```\n\nOnly run a pipeline step when `README.md` is changed:\n```yaml\n---\nkind: pipeline\nname: readme\n\nsteps:\n- name: message\n  image: busybox\n  commands:\n  - echo \"README.md was changed”\n  when:\n    paths:\n      include:\n      - README.md\n```\n\nSame as above, but with an implicit `include`:\n```yaml\n---\nkind: pipeline\nname: readme\n\nsteps:\n- name: message\n  image: busybox\n  commands:\n  - echo \"README.md was changed”\n  when:\n    paths:\n    - README.md\n```\n\n### `include` and `exclude`\n\nRun a pipeline step when `.yml` files are changed in the root, except for `.drone.yml`:\n```yaml\n---\nkind: pipeline\nname: yaml\n\nsteps:\n- name: message\n  image: busybox\n  commands:\n  - echo \"A .yml file in the root of the repo other than .drone.yml was changed\"\n  when:\n    paths:\n      include:\n      - \"*.yml\"\n      exclude:\n      - .drone.yml\n```\n\n### `depends_on`\n\nWhen using [`depends_on`](https://docker-runner.docs.drone.io/configuration/parallelism/) in a pipeline step, ensure the `paths` rules match, otherwise your steps may run out of order.\n\nOnly run two steps when `README.md` is changed, one after the other:\n```yaml\n---\nkind: pipeline\nname: depends_on\n\nsteps:\n- name: message\n  image: busybox\n  commands:\n  - echo \"README.md was changed”\n  when:\n    paths:\n      include:\n      - README.md\n\n- name: depends_on_message\n  depends_on:\n  - message\n  image: busybox\n  commands:\n  - echo \"This step runs after the message step\"\n  when:\n    paths:\n      include:\n      - README.md\n```\n\n## Changesets\n\nThe changeset is generated by comparing the list of files changed between the commit [before] the patch is applied and the commit [after] the patch is applied.\nAs a result, the changeset for a commit may be different depending on which type of event triggered the build.\n\nFor example, the `push` and `tag` events may generate a changeset against the previous commit, where as the `pull_request` event may generate a changeset against the source branch. For more specifics on how before and after are set, review the webhook [parser].\n\n[before]: https://docs.drone.io/pipeline/environment/reference/drone-commit-before/\n[after]: https://docs.drone.io/pipeline/environment/reference/drone-commit-after/\n[parser]: https://github.com/drone/drone/blob/ca454594021099909fb4ee9471720cacfe3207bd/service/hook/parser/parse.go\n\n## Known issues\n\n### Empty commits\n\nBe careful when making empty commits with [`git commit --allow-empty`](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---allow-empty). When an empty commit is made, no files have changed, so this plugin will return the unmodified `.drone.yml` back to the drone server process.\n\nThis can lead to potentially unexpected behavior, since any `include` or `exclude` rules will effectively be ignored.\n\n### YAML anchors\n\nThere is a problem in the YAML library where ordering matters during unmarshaling, see https://github.com/meltwater/drone-convert-pathschanged/issues/18\n\nThis syntax will fail:\n\n```yaml\nanchor: \u0026anchor\n  image: busybox\n  settings:\n    foo: bar\n\n- name: test\n  \u003c\u003c: *anchor\n  when:\n    event: push\n    branch: master\n```\n\nBut this will succeed:\n\n```yaml\nanchor: \u0026anchor\n  image: busybox\n  settings:\n    foo: bar\n\n- \u003c\u003c: *anchor \n  name: test\n  when:\n    event: push\n    branch: master\n```\n\n## Contributing\n\nPlease read [CONTRIBUTING.md](CONTRIBUTING.md) to understand how to submit pull requests to us, and also see our [code of conduct](CODE_OF_CONDUCT.md).\n\n### Protected Repos\n\nWhen this plugin is used in conjunction with [protected repos](https://docs.drone.io/signature/),\nsignature validation will frequently fail.\n\nThis occurs due to Drone's order of operations, in that the Drone file's \nsignature is checked after the this plugin has rewritten sections based on \nthe paths-changed triggers, resulting in a different signature for the file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMeltwaterArchive%2Fdrone-convert-pathschanged","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMeltwaterArchive%2Fdrone-convert-pathschanged","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMeltwaterArchive%2Fdrone-convert-pathschanged/lists"}