Skip to content

Build only on push and tag - #28

Closed
cyberb wants to merge 1 commit into
masterfrom
drone-trigger-push-and-tag
Closed

Build only on push and tag#28
cyberb wants to merge 1 commit into
masterfrom
drone-trigger-push-and-tag

Conversation

@cyberb

@cyberb cyberb commented Aug 31, 2026

Copy link
Copy Markdown
Member

.drone.jsonnet had no top-level trigger block, so Drone fell back to its default of building on every event. Opening a PR therefore fires a second, identical build next to the branch-push one:

#104  pending   event=pull_request   api-36-and-dependency-upgrade  b5dd403e
#103  running   event=push           api-36-and-dependency-upgrade  b5dd403e

Same commit, twice. This adds:

trigger: {
    event: [ "push", "tag" ]
}

push covers branches and master, so PRs still get built — once, via their branch push.

tag has to stay in the list. The publish to github step is gated on when: { event: [ "tag" ] }; a trigger of event: ['push'] alone would stop tag builds firing at all and silently end APK publishing to GitHub releases. That's why bitwarden's push-only trigger can't be copied here verbatim — it has no tag-gated step.

Verified with drone jsonnet + drone lint; the generated YAML keeps the release step's when: event: [tag] intact alongside the new trigger.

The pipeline had no trigger block, so Drone fell back to its default
of building every event. Opening a pull request therefore produced a
second, identical build alongside the one for the branch push — see
builds 103 and 104, both on b5dd403.

Restricting to push covers branches and master. Tag has to stay in the
list because the github-release step is gated on `when: event: tag`,
and a trigger without it would stop tag builds entirely and silently
end APK publishing. This is why the bitwarden pipeline's `event:
['push']` cannot be copied here verbatim.
@cyberb

cyberb commented Aug 31, 2026

Copy link
Copy Markdown
Member Author

Folded into #27 so the API 36 upgrade and the trigger fix land as one commit.

@cyberb cyberb closed this Aug 31, 2026
@cyberb
cyberb deleted the drone-trigger-push-and-tag branch August 31, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant