exam questions

Exam AZ-400 All Questions

View all questions & answers for the AZ-400 exam

Exam AZ-400 topic 5 question 35 discussion

Actual exam question from Microsoft's AZ-400
Question #: 35
Topic #: 5
[All AZ-400 Questions]

You manage source code control and versioning by using GitHub.

You need to ensure that a PowerShell script is executed automatically before rebase operations are performed.

What should you use?

  • A. a package
  • B. GitHub Copilot
  • C. a webhook
  • D. a gist
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
stonsite
11 months, 1 week ago
It should be Git hook not webhook.
upvoted 4 times
...
vsvaid
11 months, 3 weeks ago
I agree with vLabs. The option should have been Git hooks. https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks The pre-rebase hook runs before you rebase anything and can halt the process by exiting non-zero. You can use this hook to disallow rebasing any commits that have already been pushed. The example pre-rebase hook that Git installs does this, although it makes some assumptions that may not match with your workflow.
upvoted 1 times
...
vLabz
1 year, 1 month ago
I think there is a MAJOR misunderstanding here. Web hooks are server side and are not designed to intercept that kind of client side events just to run "scripts". The answer should have been a Git Hook, there is a pre-rebase event and you attach any script (powershell works well when all your clients are on windows, or whatever you want). I wonder how it is possible that there is such a mistake in a question here...
upvoted 4 times
...
flafernan
1 year, 3 months ago
Selected Answer: C
Triggering the webhook will not prevent the rebase from running. The webhook can be configured to trigger a PowerShell script to run before the rebase operation takes place, but the rebase itself will still happen normally. The PowerShell script can be used to perform specific actions before or after the rebase, such as performing additional checks or updates.
upvoted 2 times
...
resonant
1 year, 4 months ago
Selected Answer: C
The answer that makes most sense is C, but webhooks only makes Github perform a custom HTTP request to your server whenever a configured event happens. You can then in your server execute a Powershell script, but there is no way to guarantee it will execute before the rebase because as far as I know Github won't wait for the Powershell script to end execution because all Github does about it is to send the custom HTTP request. I don't know if Github waits for a response from the server after sending the request before proceeding, but if it isn't the case then it's impossible. Besides, I don't think there is a webhook for rebase events since rebases are made locally. You can configure a webhook for a push event, but not for rebase, that doesn't make sense.
upvoted 1 times
...
Pamban
1 year, 5 months ago
Selected Answer: C
Seems Webhook correct Source: https://docs.github.com/en/webhooks-and-events/webhooks/about-webhooks
upvoted 2 times
...
kay000001
1 year, 6 months ago
Selected Answer: C
Webhook is correct.
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...