Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(3087): Show that events was executed using Pipeline Access Token #3096

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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')) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creator setting is in payload, then it gets preference over "Pipeline Access Token".

payload.creator = {
name: 'Pipeline Access Token', // Display name
username
};
}

// Check for startFrom
Expand Down