Skip to content

Commit

Permalink
feat(3087): Show that events was executed using Pipeline Access Token (
Browse files Browse the repository at this point in the history
  • Loading branch information
y-oksaku committed Apr 25, 2024
1 parent e06c3d4 commit 8e318c9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugins/events/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = () => ({
handler: async (request, h) => {
const { buildFactory, jobFactory, eventFactory, pipelineFactory, userFactory } = request.server.app;
const { buildId, causeMessage, creator } = request.payload;
const { scmContext, username } = request.auth.credentials;
const { scmContext, username, scope } = request.auth.credentials;
const { scm } = eventFactory;
const { isValidToken } = request.server.plugins.pipelines;
const { updateAdmins } = request.server.plugins.events;
Expand Down Expand Up @@ -79,6 +79,11 @@ module.exports = () => ({

if (creator) {
payload.creator = creator;
} else if (scope.includes('pipeline')) {
payload.creator = {
name: 'Pipeline Access Token', // Display name
username
};
}

// Check for startFrom
Expand Down

0 comments on commit 8e318c9

Please sign in to comment.